asfenhero.blogg.se

Menustrip border
Menustrip border











Create a CustomColorTable class Inheriting from ProfessionalColorTable.Put a ToolStrip on your form and add DropDownButton and its sub items to it, and Set ForeColor of sub items to White.You can do it by implementing your custom color table that inherits ProfessionalColorTable and overriding correct properties. To Change the border color it is enough to follow Plutonix solution that is described in accepted answer.īut to remove that white border between the item and menu border, you should follow one of these solution: Solution 1 You might also change or disable any Theme to see if that might be causing adverse effects. You might also check that you are using a MenuStrip for the menu, Net does have another (older) menu class though you have to go searching to find it. If you are having trouble getting your overrides to work, check that you are using the right ones (or that they mean what the name implies, some are misleading at first). With the mouse over one of the items (mouse not shown), the item uses the MenuItemSelected color which was Consilk.

menustrip border

When open, the menu border is Fuschia (mmmm, soothing!) The menu gradient goes from AliceBlue to DodgerBlue an item with the mouse over it uses a top to bottom gradient of LawnGreen to MediumSeaGreen (mouse not shown). (Though, MenuBorder does seem to work no matter what.) Otherwise, results are as expected: The default should be false whether visual styles are enabled or not, but maybe something else has changed it? base.UseSystemColors = false īoth EnableVisualStyles() and UseSystemColors = false have to be in place for all the rendering elements in your color table to be implemented, otherwise only some are used. You may want to also disable system colors as shown in the ctor. You enable visual styles in Main(): // must be done before any UI elements are used If visual styles are not turned on, not all the color table items will be used and some SystemColors will be used instead. In form load: menuStrip1.Renderer = new ToolStripProfessionalRenderer(new MenuColorTable())

menustrip border

Public override Color MenuStripGradientEnd Public override Color MenuStripGradientBegin Public override Color MenuItemSelectedGradientEnd Public override Color MenuItemSelectedGradientBegin A class which inherits from ProfessionalColorTable works as expected: class MenuColorTable : ProfessionalColorTable Is it possible to change the border color of a toolstrip menu dropdown list.













Menustrip border