Combox height

G

Guest

Does anyone know how to change the combobox height?. The only way I can do this is by changing the font size.
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?SWFpbg==?= said:
Does anyone know how to change the combobox height?. The only way I can do this is by changing the font size.

\\\
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_SETITEMHEIGHT As Int32 = &H153

Private Sub Form1_Load( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles MyBase.Load
SetComboEditHeight(Me.ComboBox1, 50)
End Sub

Private Sub SetComboEditHeight( _
ByVal Control As ComboBox, _
ByVal NewHeight As Int32 _
)
SendMessage(Control.Handle, CB_SETITEMHEIGHT, -1, NewHeight)
Control.Refresh()
End Sub
///
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi Iain,

Combobox is a weird control. IMHO it doesn't fit the framework at all. I
hope they will fixed for VS .NET 2005. Anyways there is no way to change the
height unless you change the font or make it ownerdraw

--

Stoitcho Goutsev (100) [C# MVP]


Iain said:
Does anyone know how to change the combobox height?. The only way I can do
this is by changing the font size.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top