vb中组合框(combo)怎样做到按“向下”键显示下拉列表?

2025-05-16 16:03:32
推荐回答(2个)
回答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 = 40 Then
SendMessage Combo1.hwnd, CB_SHOWDROPDOWN, 1, vbNullString
End If
End Sub

回答2:

支持guanguanwky的说法!回答的不错,支持一下!