combo1.setfocus
sendkeys "^DOWN"送Ctrl+DOWN

解决方案 »

  1.   

    sub combo1_getfocus()
      sendkeys "%DOWN"
    end sub
      

  2.   

    F4也行!SendMessage combo1.hWnd, WM_KeyDown, VK_F4, byval 0&(API声明自己加)
      

  3.   

    哦,谢谢,我解决了!呵呵,你这样好象不能执行,代码应该这样:
    sendkeys "%"+"{down}"
      

  4.   

    也谢谢zyl910(910:分儿,我来了!) 从你们那里学到了很多东西!收益非浅!!呵呵
      

  5.   

    sendkeys "%{DOWN}"
    呵呵,少了{}
      

  6.   

    呵呵,我又碰到一个问题,用了sendkeys后怎么鼠标没了?必须点击以下才会出现.
      

  7.   

    用sendkeys有时会导致焦点丢失
    所以建议发送WM_KeyDown消息
      

  8.   


    大家转VB。NET吧那里只要
    COMBOBOX1.DROPDOWNED=TRUE
      

  9.   

    zyl910(910:分儿,我来了!) :
    你能说得详细点吗?对这方面我不是太熟,呵呵,谢谢!
      

  10.   

    '用 SendMessage 函数向 ComboBox 发送 CBS_DROPDOWN 或 CBS_DROPDOWNLIST 消息
    Private Const CB_SHOWDROPDOWN = &H14F
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongPrivate Sub Command1_Click()
      SendMessage Combo1.hwnd, CB_SHOWDROPDOWN, True, 0&
    End Sub
    'MSDN
    'CB_SHOWDROPDOWN
    'An application sends a CB_SHOWDROPDOWN message to show or hide the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.
    '
    'To send this message, call the SendMessage function with the following parameters.
    '
    'SendMessage(
    '  (HWND) hWnd,        // handle to destination window
    '  CB_SHOWDROPDOWN,    // message to send
    '  (WPARAM) wParam,    // show state
    '  (LPARAM) lParam     // not used; must be zero
    ');
    'Parameters
    'wParam
    'Specifies whether the drop-down list box is to be shown or hidden. A value of TRUE shows the list box; a value of FALSE hides it.
    'lParam
    'This parameter is not used.
    'Return Values
    'The return value is always TRUE.
    '
    'Res
    'This message has no effect on a combo box created with the CBS_SIMPLE style.
      

  11.   

    footballboy(郑创斌) :
    谢谢!我试试!呵呵