不是
SendKeys="{F4}"
是这个
Private Sub Combo1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        SendKeys "{F4}"
    End If
End Sub

解决方案 »

  1.   

    首先谢谢楼上的帮助。但是在使用了我贴上的那段代码以及Keypreview=True的前提下,您所说的方法没有达到目的,KeyPress事件不触发。
      

  2.   

    用API函数SendMessage可以控制组合框的列表框部分的显示和隐藏SendMessage Combo1.hwnd,CB_SHOWDROPDOWN,True,Byval 0& '显示
    SendMessage Combo1.hwnd,CB_SHOWDROPDOWN,False,Byval 0& '隐藏
      

  3.   

    如果你不想用api的话,那么改为
    Private Sub Form_KeyPress(KeyAscii As Integer)
       if keyascii=13 then
          combo1.setfocus
          sendkeys "{F4}"
       end if
    end sub或者Private Sub Form_KeyPress(KeyAscii As Integer)
       if keyascii=13 then
          SendMessage Combo1.hwnd,CB_SHOWDROPDOWN,True,Byval 0& '显示
       end if
    end sub