ComboBox before drop down event?

StewartBW 1,145 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

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,011 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,737 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 45,701 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,490 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.