Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop ComboBox List from Code 1

Status
Not open for further replies.

Foada

Programmer
Feb 4, 2002
1,110
US
Hi Everyone. Here is what I am trying to do. I have an option button that enables a combo box. What I would like to do would be drop the combo box list at the same time I enable it. Has anyone done anything like this or do I need to make a mock combo box with a command button, textbox and a listbox. Thanks in advance.[spineyes] Anything is possible, the problem is I only have one lifetime.
[cheers]
 
Hi,

Try this....

'Add a module to your project (In the menu choose Project - Add Module, Then click Open)
'Insert 1 ComboBox to your form (named Combo1).
'Insert this code to the module declarations:

Public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam _
As Long, ByVal lParam As Long) As Long

Public Const CB_SHOWDROPDOWN = &H14F

'Insert the following code to your form:

Private Sub Form_Load()
r = SendMessageLong(Combo1.hwnd, CB_SHOWDROPDOWN, True, 0)
End Sub
 
Just what the Doctor ordered [wiggle]. Thanks robdon Anything is possible, the problem is I only have one lifetime.
[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top