vb6 combo怎么能使其在不用鼠标的前提下,下拉表示内容

2025-04-29 12:08:06
推荐回答(1个)
回答1:

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
Private Const CB_SHOWDROPDOWN = &H14F

Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 39 Or KeyCode = 37 Then
SendMessage Combo1.hwnd, CB_SHOWDROPDOWN, True, 0
End If

End Sub

如果控制长度就不知道了