我们知道ComboCox的Height属性是只读的,那么怎么改变ComboBox控件自身的高度呢,答案很简单,就是发送CB_SETITEMHEIGHT消息:
Option Explicit
Private Const CB_SETITEMHEIGHT& = &H153
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 Sub Command1_Click()
Dim NewHeight As Long
NewHeight = 40'以像素为单位
SendMessage Combo1.hwnd, CB_SETITEMHEIGHT, -1, ByVal NewHeight
End Sub