How can I bind a collection of C# 7.0 tuple type values to a System.Windows.Forms.Listbox and set the display member to one of the elements?
Unfortunately C#7 value tuples cannot be used for data binding because they use fields, while Windows Forms standard data binding works only with properties.
Ivan's answer, definitely describes the case. As a workaround you can use Format
event of ListBox
to show name
filed:
private void listBox1_Format(object sender, ListControlConvertEventArgs e)
{
e.Value = (((string name, int ID))e.ListItem).name;
}