本文介绍了如何在C#和WinForms中将项目添加到列表框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在弄清楚如何将项目添加到在WinForms中是 ListBox 。
I'm having trouble figuring out how to add items to a ListBox in WinForms.
我尝试过:
list.DisplayMember = "clan"; list.ValueMember = sifOsoba;如何将 ValueMember 添加到列表中 int 的值和 DisplayMember 的一些文本?
How can I add ValueMember to the list with an int value and some text for the DisplayMember?
list.Items.add(?)顺便说一句。出于任何原因,我都无法使用 ListBoxItem 。
推荐答案list.Items.add(new ListBoxItem("name", "value"));
ListBox的内部(默认)数据结构为 ListBoxItem 。
The internal (default) data structure of the ListBox is the ListBoxItem.
更多推荐
如何在C#和WinForms中将项目添加到列表框?
发布评论