“Windows formuls Link Listbox zu Array” Code-Antworten

Windows formuls Link Listbox zu Array

List<string> listToBind = new List<string> { "AA", "BB", "CC" };
this.listBox1.DataSource = listToBind;
Long Tailed Spotted Cat

Windows formuls Link Listbox zu Array

public class MyClass
{
    public int Id { get; set; }
    public string Text { get; set; }
    public MyClass(int id, string text)
    {
        this.Id = id;
        this.Text = text;
    }
}
Long Tailed Spotted Cat

Windows formuls Link Listbox zu Array

List<MyClass> listToBind = new List<MyClass> { new MyClass(1, "One"), new MyClass(2, "Two") };
this.listBox1.DisplayMember = "Text";
this.listBox1.ValueMember = "Id"; // optional depending on your needs
this.listBox1.DataSource = listToBind;
Long Tailed Spotted Cat

Ähnliche Antworten wie “Windows formuls Link Listbox zu Array”

Fragen ähnlich wie “Windows formuls Link Listbox zu Array”

Weitere verwandte Antworten zu “Windows formuls Link Listbox zu Array” auf C#

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen