Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 16th, 2012  |  syntax: C#  |  size: 0.54 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  private void LoadPlanetList()
  2.         {
  3.             if (this.comboBoxPlanetList.InvokeRequired)
  4.             {
  5.                 MessageBox.Show("invoke required");
  6.             }
  7.             else
  8.             {
  9.                 comboBoxPlanetList.ValueMember = "Key";
  10.                 comboBoxPlanetList.DisplayMember = "Value";
  11.                 comboBoxPlanetList.DataSource = new BindingSource(PlanetList, null);
  12.             }
  13.         }
  14. //this line causes a threading error without the if statement.
  15. comboBoxPlanetList.ValueMember = "Key";
  16. fi