// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; namespace E { public class Foobar { public string A { get; set; } public string B { get; set; } public string AB { get { return A + "#" + B; } } } public partial class MainForm : Form { public MainForm() { InitializeComponent(); List lst = new List(); lst.Add(new Foobar{ A="A1", B="B1" }); lst.Add(new Foobar{ A="A2", B="B2" }); checkedListBox1.Items.AddRange(lst.ToArray()); checkedListBox1.DisplayMember = "AB"; } } }