I want to show the List Box of a Combo Box by code.
Using this declare it shows the list box but it immediately hides it again.
What am I doing wrong?
Thanks in advance.
Soft Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As UInt32, ByVal wParam As Integer, lParam As Integer) As Integer
Const CB_SHOWDROPDOWN = &H14F
Call SendMessage(Me.Handle, CB_SHOWDROPDOWN, 1, 0)
My code was Ok, and no, unfortunately your code did not work as I had it in my machine.
But thanks to your example I noticed that the problem was where I put my code.
I wanted to show the ListBox when somebody clicked in the ComoboBox rectangle, not only on the down arrow.
And I decided to put this code on the MouseDown event. But when I changed it to MouseUp event everything has worked.
So, thank you very much