Postada em 31/12/2008 11:05 hs
Em um Módulo
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
Public Sub SetComboHeight(oComboBox As ComboBox, lNewHeight As Long)
Dim oldscalemode As Integer
If TypeOf oComboBox.Parent Is Frame Then Exit Sub
oldscalemode = oComboBox.Parent.ScaleMode oComboBox.Parent.ScaleMode = vbPixels
MoveWindow oComboBox.hwnd, oComboBox.Left, _ oComboBox.Top, oComboBox.Width, lNewHeight, 1
oComboBox.Parent.ScaleMode = oldscalemode End Sub
Agora no form coloque isto
Private Sub Form_Load()
Dim i As Integer For i = 1 To 15 Combo1.AddItem "Item " & i Next
Call SetComboHeight(Combo1, 400) End Sub
*** Onde 400 é o número que você aumenta ou diminui conforme o tanto de registro que quer mostrar quando abrir a combo.
|