winforms - How to change the back color of tool strip split button in windows form c# -
how change color of tool strip split button in windows forms application. color property not working.. code in designer class..
this.level.backcolor = system.drawing.color.fromargb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); this.level.displaystyle = system.windows.forms.toolstripitemdisplaystyle.image; this.level.dropdownitems.addrange(new system.windows.forms.toolstripitem[] { this.autotoolstripmenuitem1, this.loadtoolstripmenuitem1}); this.level.image = global::pacs.properties.resources.winlevel; this.level.imagetransparentcolor = system.drawing.color.red; this.level.margin = new system.windows.forms.padding(1, 1, 1, 2); this.level.name = "level"; this.level.size = new system.drawing.size(53, 43); this.level.text = "level"; this.level.textimagerelation = system.windows.forms.textimagerelation.overlay; this.level.paint += new system.windows.forms.painteventhandler(this.window_level_paint); this.level.click += new system.eventhandler(this.window_level_click);
it's backcolor property did not work default: accorthing (toolstripsplitbutton backcolor not work), follow these 2 steps:
1) set backgroundimage valid image. not matter what. use 1 pixel x 1 pixel bmp local resource.
2) set backgroundimagelayout none. why not matter image use above.
result:

Comments
Post a Comment