ComboBox before drop down event?

StewartBW 1,805 Reputation points
2024-05-18T00:15:41.8566667+00:00

Hello

I'm looking for an event in ComboBox in .net framework WinForms which fires before the drop down menu is going to drop, when DropDownStyle is set to DropDown, so when user clicks on the far button, I add some items to the list on the fly and then the list shows. is there such event? thanks

Developer technologies VB
Developer technologies C#
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 49,536 Reputation points
    2024-05-18T10:53:37.1566667+00:00

    You can add items to a ComboBox in the handler for the ComboBox.DropDown Event.

    They will be added before the dropdown list is displayed;

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. KOZ6.0 6,655 Reputation points
    2024-05-18T06:35:43.07+00:00

    No events before DropDown event.

    If you were to implement it, you would want it to occur when F4 is pressed in the KeyDown event and when the mouse position is within the button in WM_LBUTTONDOWN.

    The position of the button can be obtained using GetComboBoxInfo function.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.