Hi all,
Well, looks like there are lots of questions like this, but I haven't been able to solve it, I need to resize the combobox with the following API, it resizes it ok, but the text looks cutted, so there seems to be a top padding inside the combo that pushes text down, can someone help me how to get rid of this padding?, Thanks in advance =)
Private animals() As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
animals = New String() {"Elephant", "c r o c o d i l e", "lion"}
ComboBox1.DataSource = animals
SetComboEditHeight(ComboBox1, 12)
End Sub
Private Declare Auto Function SendMessage Lib "user32.dll" ( _
ByVal hwnd As IntPtr, _
ByVal wMsg As Int32, _
ByVal wParam As Int32, _
ByVal lParam As Int32) As Int32
Private Const CB_ERR As Int32 = -1
Private Const CB_SETITEMHEIGHT As Int32 = &H153
Private Sub SetComboEditHeight(ByVal Control As ComboBox, ByVal NewHeight As Int32)
SendMessage(Control.Handle, CB_SETITEMHEIGHT, -1, NewHeight)
Control.Refresh()
End SubG.Waters