This works in VS2013 net FrameWork4.5 VB code
Place the declaration and constant at the top of the class
Usage places the rest of the code in Form_Load, as in the code example.
Private Declare Function SendMessageByNum Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As IntPtr, ByVal wMsg As UInt32, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr Private Const lB_SETITEMHEIGHT As Integer = &H1A0 Private Sub Form_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ItemHeight As Integer = Me.Font.Height + 4 SendMessageByNum(CheckedListBoxControl.Handle, lB_SETITEMHEIGHT, CType(0, IntPtr), CType(ItemHeight, IntPtr)) End Sub
source share