Tag Archives: اضافه

اضافه کردن آیتم به لیست باکس در C# How might I add an item to a ListBox?

c# Shrp Programing

list.Items.add(new ListBoxItem("name", "value")); The internal (default) data structure of the ListBox is the ListBoxItem. You can choose what do display using the DisplayMember of the ListBox. List<SomeData> data = new List<SomeData>(); data.Add(new SomeData() { Value = 1, Text= "Some Text"}); data.Add(new SomeData() { Value = 2, Text = "Some Other Text"}); listBox1.DisplayMember = "Text"; listBox1.DataSource = data; When the user …

Read More »