Custom-drawn combobox

  • Thread starter Thread starter Richard Bateman
  • Start date Start date
R

Richard Bateman

I need to make a combo box that doesn't look like the
standard windows controls. I thought that extending the
combobox control would make the most sense, so I could draw
it myself.

However, when I do this, it doesn't seem to work. How can
one change the look of the combobox control?

I know you can set the userdraw stuff and impliment the
event handler, but that only lets you change the look of
each item. I need to change the box itself, arrow and all.

Any ideas? this is driving me nuts.

Richard
 
Derive your control from Combo-box and handle the OnPaint method without
calling base.OnPaint

-vJ
 
Create your own control with your own button and button pic? I have not
done this with a combobox before, but I think this work work. Add your
textbox control with button next to it to look like a combo box. Your
control rectangle size will normally be the height of the textbox allowing
for border (may need to play with that, not sure.) Add a listbox or other
control under the textbox. When the button is clicked, your control
rectangle will size to "around" the textbox and the listbox, so you see
both. You'd need to hook everything up to make the controls work together
as a unit and add properties and methods. This would be flexible and allow
you to use standard controls without any manual painting.
 
Back
Top