Home » Controls » How to set the ComboBox DropDown List Height
How to set the ComboBox DropDown List Height
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 'Controls - How to set the ComboBox DropDown List Height Option Explicit 'Add two ComboBoxes to your form. Public Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, _ ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long Function SetComboHeight(YourCombo As ComboBox, lDropDownHeight As Long) Dim iScaleMode As Integer If TypeOf YourCombo.Parent Is Frame Then Exit Function iScaleMode = YourCombo.Parent.ScaleMode YourCombo.Parent.ScaleMode = vbPixels MoveWindow YourCombo.hwnd, YourCombo.Left, YourCombo.Top, YourCombo.Width, lDropDownHeight, 1 YourCombo.Parent.ScaleMode = iScaleMode End Function 'How can I call this function: Private Sub Main() SetComboHeight Combo1, 100 End Sub |
Enjoy this article?
Filed under: Controls
Leave a comment