drop down the list in a combobox programmatically 
Author Message
 drop down the list in a combobox programmatically

Hi,

Does anybody know how to drop down the list in  a combobox
programmatically?

thanks,
Xiaoming



Sun, 09 Jun 2002 03:00:00 GMT  
 drop down the list in a combobox programmatically

Quote:

>Hi,

>Does anybody know how to drop down the list in  a combobox
>programmatically?

Put the following declarations in the General Declarations section of the
form:

Private Declare Function SendMessage Lib "user32" Alias _
    "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
    ByVal wParam As Long, lParam As Any) As Long
Const CB_SHOWDROPDOWN = &H14F

Use this code to show the list:

        Dim lRet As Long
        lRet = SendMessage(Combo1.hWnd, CB_SHOWDROPDOWN, 1, 0)

This to retract the list:

        Dim lRet As Long
        lRet = SendMessage(Combo1.hWnd, CB_SHOWDROPDOWN, 0, 0)

Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner



Sun, 09 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Populate an IE drop-down list programmatically

2. combobox : how to pull down list programmatically

3. Drop Down List Box - Drop Down portion does not always disappear after Click event

4. Drop-Down List (ComboBox) and Text Box questions

5. Combobox used as a drop down list in a datagrid

6. Combobox / Drop down list

7. User Input for ComboBox Drop Down List

8. How to clear text of drop-down list combobox

9. How to clear text of drop-down list combobox

10. How do I make a ComboBox with a drop-down wider then the ComboBox

11. Drop-down list in a list view

 

 
Powered by phpBB® Forum Software