title: set ComboBox selected item by Key not by value c#
body: <p>Before post this question ,I believe it is simple issue , I search for the answer and didn't find suitable solution.</p>
  
  <p>in my daily work , I am working with web applications and can easily get or set values of dropdownlists</p>
  
  <p>i can not do the same in windows application C# </p>
  
  <p>I have combobox and class comboItem</p>
  
  <pre><code> public class ComboItem
      {
          public int Key { get; set; }
          public string Value { get; set; }
          public ComboItem(int key, string value)
          {
              Key = key; Value = value;
          }
          public override string ToString()
          {
              return Value;
          }
      }
  </code></pre>
  
  <p>Say the combobox is binded through hard code and the values are </p>
  
  <ul>
  <li>Key : 1  / Value : Male</li>
  <li><p>Key : 2  / Value : Female</p></li>
  <li><p>Key : 3  / Value : Unknown</p></li>
  </ul>
  
  <p>lets say i have the Key =3 and I want to set this item ( whose key is 3 ) through code
  so when form is loaded , the selected value by default will be Unknown.</p>
  
  <pre><code>combobox1.selectedValue =3 //Not Working , selectedValue used to return an object
  combobox1.selectedIndex = 2 //Working as 2 is the index of key 3/Unknown
  </code></pre>
  
  <p>but lets say i don't know the index , how can i get the index of item whose key = 3 ? </p>
  
  <p>index can be get through value in this way </p>
  
  <pre><code>int index = combobox1.FindString("Unknown") //will return 2
  </code></pre>
  
  <p>FindString take a value not a key , i need something like FindString which take a key and return index </p>
  
  <p>NOTE : 
  Here is how i bind my drop down menu</p>
  
  <pre><code> JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings();
                          jsonSerializerSettings.MissingMemberHandling = MissingMemberHandling.Ignore;
  
                          var empResult= await response.Content.ReadAsStringAsync();
                          List&lt;Emp&gt; Emps= JsonConvert.DeserializeObject&lt;Emp[]&gt;(empResult, jsonSerializerSettings).ToList();
                          foreach (var item in Emps)
                          {
                              ComboItem CI = new ComboItem(int.Parse(item.ID), item.Name);
                              combobox1.Items.Add(CI);
                          }
                          this.combobox1.DisplayMember = "Value";
                          this.combobox1.ValueMember = "Key";
  </code></pre>