ComboBox in flat style?

  • Thread starter Thread starter Morten Wennevik
  • Start date Start date
M

Morten Wennevik

Like a Button and RadioButton has a FlatStyle and a TextBox has a
BorderStyle, is it possible to set a ComboBox to appear in the same way?
No 3D borders.
 
Hi Morten,

The answer is simple, but I suppose not want you to hear (read). So the
answer is "not easy".
Combobox control does not support flat style. Furthermore it is one pixel
higher than the edit control. As long as the edit control height can be
changed after setting AutoSize property to *false*, Combobox doesn't have
AutoSize property. Its height is bound to the font size. To change the
height of the combobox you have to either change the size of the font or
make the combobox owmner draw and change the ItemHeight property (but I
believe you know what means to make Combobox ownerdraw).

Back to your question; the only way to make it flat is to draw it by
yourself.

So, it is hard to say that the Windows Forms' combobox is a perfect control.
 

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

Back
Top