2

I have a problem focusing a ComboBox in a Windowsforms "ToolStrip" (C++ Cli).

I used the Designer to create a ToolStrip in my form and added a ComboBox (System.Windows.Forms.ToolStripComboBox) and it is visible and enabled.
When the form is loaded I want that Combobox to be selected, so I tried the following in the form-constructor.

this->CBox1->focus()

and

this->ToolStrip1->focus()  
this->CBox1->select()

none works.

Does anybody know how to make it work?

Zeus
  • 123
  • 1
  • 6

1 Answers1

1

The ToolStripComboBox class contains a ComboBox property that enables you to access its embedded ComboBox control. This appears to work (C# code):

this.Cbox1.ComboBox.Select();
dandan78
  • 13,328
  • 13
  • 64
  • 78
  • Thanks alot. It works perfectly. I found some info about that ComboBox inside the ToolStripComboBox, but i couldn't make it work :( – Zeus Jun 16 '11 at 14:10