Hi,
I just want to make my own custom ComboBox to change its height, so here's my code but I just can't make it work, any help would be appreciated, thanks in advance.
Public Class DxCombo
Inherits System.Windows.Forms.ComboBox
Private _DxHeight As Int16 = 12
Public Property DxHeight() As Int16
Get
Return _DxHeight
End Get
Set(ByVal value As Int16)
_DxHeight = value
End Set
End Property
Public Sub New()
DrawMode = DrawMode.OwnerDrawFixed
FlatStyle = Windows.Forms.FlatStyle.Flat
SetComboEditHeight(Me, DxHeight)
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 Sub
End ClassG.Waters