ToolStrip button BackColor does nothing?

M

MLM450

I am trying to create a button on a toolstrip that is used to select a
color. After the user selects their color, a portion of the button's
image is changed to that color (similar to the highlighter button in
Microsoft Word).

How can this be done? I tried making part of the button's image
transparent and then changed the button's BackColor to the selected
color. It appears that BackColor does not affect anything. That seems
to be true even if you change the BackColor at design time.

Any ideas?
 
A

Andrej Tozon

If you want to achieve this kind of button behaviour I'd suggest you compose
the toolbar image in-memory and asign the result to button's image.
If you want to change the button's BackColor, change ToolStrip's RenderMode
property to 'System'. This way you'll override the default 'Professional'
renderer and will have to assign all custom toolstrip's colors yourself. You
could also write your own toolstrip renderer.

Andrej
 

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