Winforms: how to open combobox properly?

后端 未结 5 1035
醉梦人生
醉梦人生 2020-12-06 16:26

I have a combobox on the winforms. On Enter even I open it:

cbo.DroppedDown = true;

But if I do that the combo opens and closes immediately

5条回答
  •  广开言路
    2020-12-06 16:38

    I tried it just like this:

    private void comboBox1_enter(object sender, EventArgs e)
          {
             comboBox1.DroppedDown = true;
          }
    

    no changes to mouseup or timers. it behaved just as expected. Whether I selected the comboBox with a mouse click or tabbed into it the drop down list appeared and stayed open until I selected something.

    I would look to see if there is something else pulling focus off the box.

提交回复
热议问题