Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C# - リストビューにハッシュテーブルを追加するにはどうすればよいですか? Hashtable を返す関数があり、Hashtable の内容を Listview に追加できるようにしたいと考えています。
情報が不足しているため非常に一般的ですが、次の行に沿ったものです。
foreach (var item in hashtable.Values) { listView.Items.Add(new ListViewItem(item.ToString())); }
現在の値と値として、ListView's DisplayMemberまたはKeyその逆を任意の方法で提供できます。HashtableValueMemberHashTable
ListView's
DisplayMember
Key
Hashtable
ValueMember
HashTable