Combobox button color

D

Dave Wurtz

Can anyone tell me how to get the current color of a combobox's button?
I have a custom control that I want to look similar to a combobox. It
contains a button control that I want to look like the button on a
combobox.

If possible, I would also like to get the arrow image that is used on
the combobox.

When different styles are used, the colors and image changes.

Thanks for the help in advance!

Dave Wurtz
 
H

Herfried K. Wagner [MVP]

Dave Wurtz said:
Can anyone tell me how to get the current color of a combobox's button?
I have a custom control that I want to look similar to a combobox. It
contains a button control that I want to look like the button on a
combobox.

If possible, I would also like to get the arrow image that is used on
the combobox.

'SystemColors.Control' will give you the color,
'ControlPaint.DrawComboButton' can be used to draw the button.
 
D

Dave Wurtz

I don't quite understand how to use the ControlPaint.DrawComboButton
and there are very few examples. Do you have an example of how to use
this?

Thanks.
Dave
 
H

Herfried K. Wagner [MVP]

Dave Wurtz said:
I don't quite understand how to use the ControlPaint.DrawComboButton
and there are very few examples. Do you have an example of how to use
this?

\\\
Private Sub Form1_Paint( _
ByVal sender As Object, _
ByVal e As PaintEventArgs _
) Handles MyBase.Paint
ControlPaint.DrawComboButton( _
e.Graphics, New Rectangle(10, 10, 20, 20), ButtonState.Normal _
)
End Sub
///
 

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