[英]c# How do I open the combobox when the button is clicked
private void button1_Click(object sender, EventArgs e) {
cb_brand_Click(cb_brand, new EventArgs());
}
detected as clicked, but not detected as a directory after adding and refreshing the data I typed检测为单击,但在添加和刷新我键入的数据后未检测为目录
Hi you can try this,你好,可以试试这个
private void button1_Click(object sender, EventArgs e)
{
comboBox1.Focus();
comboBox1.DroppedDown = true;
}
I'm not sure exactly what you are wanting to do but this should open ComboBox1 so you could put it in your on click event of the button.我不确定您到底想要做什么,但这应该打开 ComboBox1 以便您可以将其放入按钮的单击事件中。 obviously change the name of ComboBox1 to whatever your combo box is called.
显然将 ComboBox1 的名称更改为您的组合框的名称。
ComboBox1.DroppedDown = !ComboBox1.DroppedDown;
use this用这个
private void button1_Click(object sender, EventArgs e) {
comboBox1.DroppedDown = true;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.