在 Windows 窗体 ToolStrip 中选择组合框
我在聚焦 Windowsforms“ToolStrip”(C++ Cli)中的 ComboBox 时遇到问题。
我使用设计器在表单中创建了一个 ToolStrip,并添加了一个 ComboBox (System.Windows.Forms.ToolStripComboBox),它是可见的并已启用。
加载表单时,我希望选择该组合框,因此我在表单构造函数中尝试了以下操作。
this->CBox1->focus()
没有
this->ToolStrip1->focus()
this->CBox1->select()
一个有效。
有人知道如何让它发挥作用吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ToolStripComboBox
类包含一个ComboBox
属性,使您能够访问其嵌入的ComboBox
控件。这似乎有效(C# 代码):The
ToolStripComboBox
class contains aComboBox
property that enables you to access its embeddedComboBox
control. This appears to work (C# code):