title: 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?
body: <p>I have a <code>System.Windows.Forms.Listbox</code> and a collection of tuple type values I've created.  That is, <a href="https://blogs.msdn.microsoft.com/dotnet/2016/08/24/whats-new-in-csharp-7-0/" rel="noreferrer">the new tuple type introduced in C# 7.0</a>.  I'm trying to bind the collection to the <code>Listbox</code> and set the <code>DisplayMember</code> to one of the elements in the tuple.  Here's an example:</p>
  
  <pre><code>var l = new List&lt;(string name, int ID)&gt;()
  {
      ("Bob", 1),
      ("Mary", 2),
      ("Beth", 3)
  };
  
  listBox1.DataSource = l;
  listBox1.DisplayMember = "name";
  </code></pre>
  
  <p>That doesn't work, though.  With the older-style <code>Tuple&lt;T&gt;</code> you could supposedly do what's described <a href="https://stackoverflow.com/a/45556045/2704659">in this answer</a>:</p>
  
  <pre><code>listBox1.DisplayMember = "Item1";
  listBox1.ValueMember = "Item3";   // optional
  </code></pre>
  
  <p>That doesn't work either.  Here's what I'm seeing in both cases:</p>
  
  <p><a href="https://i.stack.imgur.com/VsapA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VsapA.png" alt="enter image description here"></a></p>
  
  <p>How can I accomplish this?</p>