rainstormmaster的blog
rainstormmaster的blog

我们知道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

 

posted on 2006-02-20 05:26  学剑学诗两不成  阅读(2692)  评论(0编辑  收藏  举报