
Untitled
By: a guest on
May 16th, 2012 | syntax:
C# | size: 0.54 KB | hits: 16 | expires: Never
private void LoadPlanetList()
{
if (this.comboBoxPlanetList.InvokeRequired)
{
MessageBox.Show("invoke required");
}
else
{
comboBoxPlanetList.ValueMember = "Key";
comboBoxPlanetList.DisplayMember = "Value";
comboBoxPlanetList.DataSource = new BindingSource(PlanetList, null);
}
}
//this line causes a threading error without the if statement.
comboBoxPlanetList.ValueMember = "Key";
fi