1

I am calling the following on ToolStripMenu item click :

protected void windowNewMenu_Click(object sender, EventArgs e)
    {
     if (_selectedThings.Contains(((ToolStripMenuItem)sender).Tag))
     {
        selectedItemsPropertyGrid.SelectedObject = ((ToolStripMenuItem)sender).Tag;
        selectedItemsComboBox.SelectedText = (((ToolStripMenuItem)sender).Tag.GetType()).ToString();
     }
    }

However the second line that is supposed to change does not seem to produce any visible changes to the ComboBox. Any Suggestions?

Prashanth Thurairatnam
  • 4,353
  • 2
  • 14
  • 17
jth41
  • 3,808
  • 9
  • 59
  • 109

1 Answers1

2

SelectedText is for highlighting a portion of the text, not selecting an item in the list. For that, you need SelectedItem.

Or you can just use:

selectedItemsComboBox.Text = ...
LarsTech
  • 80,625
  • 14
  • 153
  • 225