How to handle ContextMenuStrip
property, especially border-color???
Any method in C# OR Any way by using Windows API (DllImport)?
You can create custom Color table and change Renderer property:
public class MenuColorTable : ProfessionalColorTable
{
public MenuColorTable()
{
UseSystemColors = false;
}
public override Color MenuBorder
{
get { return Color.Fuchsia; }
}
public override Color MenuItemBorder
{
get { return Color.DarkViolet; }
}
public override Color MenuItemSelected
{
get { return Color.Cornsilk; }
}
public override Color MenuItemSelectedGradientBegin
{
get { return Color.LawnGreen; }
}
public override Color MenuItemSelectedGradientEnd
{
get { return Color.MediumSeaGreen; }
}
public override Color MenuStripGradientBegin
{
get { return Color.AliceBlue; }
}
public override Color MenuStripGradientEnd
{
get { return Color.DodgerBlue; }
}
}
Changing Renderer
:
contextMenuStrip1.Renderer = new ToolStripProfessionalRenderer(new MenuColorTable());