title: C# WindowsForm Combobox showing wrong "Display Value"
body: <p><strong>Goal:</strong></p>
  
  <ul>
  <li><p>Get all file directories from MySQL and place them into a dictionary.</p></li>
  <li><p>Display them into a combobox just as the filename. e.g. <code>filename</code></p></li>
  <li><p>Assign the combobox value as the the full directory. e.g. <code>c:\users\user\desktop\filename.jpg</code></p></li>
  </ul>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>string filenames = "select filename from  request_label_signoff where progress_user1 is null or progress_user2 is null";
  
  //On load - load specific images from query above
  private void Form15_Load(object sender, EventArgs e)
  {
  
      //Dict to store file into
      Dictionary&lt;string, string&gt; files = new Dictionary&lt;string, string&gt;();
  
      using (var conn = new MySqlConnection(connString))
      {
          conn.Open();
          using (var cmd = new MySqlCommand(filenames, conn))
          {
              using (MySqlDataReader reader = cmd.ExecuteReader())
              {
                  while (reader.Read())
                  {   
                      //add filename without extension and full directory
                      files.Add(Path.GetFileNameWithoutExtension(reader.GetString(0)), reader.GetString(0));
                  }
              }
          }
  
      }
  
          comboBox1.DataSource = new BindingSource(files, null);
          comboBox1.DisplayMember = "Key";
          comboBox1.ValueMember = "Value";
  
  }
  
  
  
  
  private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  {
      value = ((KeyValuePair&lt;string, string&gt;)comboBox1.SelectedItem).Value;
      pictureBox1.Image = Image.FromFile(value);
  
  }
  </code></pre>
  
  <p><strong>Problem:</strong></p>
  
  <p>For some reason the display value for the combobox shows like this:</p>
  
  <p><a href="https://i.stack.imgur.com/Kmtnd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kmtnd.jpg" alt="enter image description here"></a></p>
  
  <p>Text output: <code>[abc 123, C:\Users...]</code></p>
  
  <p>Whereas it should be <code>abc 123</code> without the directory next to it.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>Why does he combo-box display value show both items?</p>