S
Steve Le Monnier
I've designed a user interface the uses the flat xp look for my controls,
but the crazy decision by ms to make the combo box 1 pixel higher than a
text box is really messing up my design.
I really need to adjust the size of this control without having to resort to
creating my own.
I have found a vb api call that solves my problem, but...
1. should i use it.
2. how do i convert it to csharp.
3. could i hold place this code in an inherited combo class componet.
The code is as follows:
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 Sub SetComboEditHeight(ByVal Control As ComboBox, ByVal NewHeight As
Int32)
Const CB_SETITEMHEIGHT As Int32 = &H153
SendMessage(Control.Handle, CB_SETITEMHEIGHT, -1, NewHeight)
Control.Refresh()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
SetComboEditHeight(Me.ComboBox1, 14)
End Sub
but the crazy decision by ms to make the combo box 1 pixel higher than a
text box is really messing up my design.
I really need to adjust the size of this control without having to resort to
creating my own.
I have found a vb api call that solves my problem, but...
1. should i use it.
2. how do i convert it to csharp.
3. could i hold place this code in an inherited combo class componet.
The code is as follows:
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 Sub SetComboEditHeight(ByVal Control As ComboBox, ByVal NewHeight As
Int32)
Const CB_SETITEMHEIGHT As Int32 = &H153
SendMessage(Control.Handle, CB_SETITEMHEIGHT, -1, NewHeight)
Control.Refresh()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
SetComboEditHeight(Me.ComboBox1, 14)
End Sub