For my Application I use a contextmenu with a dark theme. This was implemented with a custom "ToolStripProfessionalRenderer" which work fine until the property "showImageMargin" is used.This results in a remaining white line on the left side of the context menu. image
I suspect that this is the background of the context menu, as the border of the context menu and ToolStripMenuItem is still visible. After setting the Background, the imageMargin was just white.
class darkToolStripRenderer : ToolStripProfessionalRenderer {
public darkToolStripRenderer() : base(new DarkColorTable()) {
}
protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) {
e.ArrowColor = Color.White;
base.OnRenderArrow(e);
}
}
public class DarkColorTable : ProfessionalColorTable {
public static Color AccentColor= Color.Green;
public override Color MenuItemBorder {
get { return AccentColor; }
}
public override Color MenuBorder {
get { return AccentColor; }
}
public override Color MenuItemPressedGradientBegin {
get { return ColorTranslator.FromHtml("#4C4A48"); }
}
public override Color MenuItemPressedGradientEnd {
get { return ColorTranslator.FromHtml("#5F5D5B"); }
}
public override Color ToolStripBorder {
get { return AccentColor; }
}
public override Color MenuItemSelectedGradientBegin {
get { return ColorTranslator.FromHtml("#404040"); }
}
public override Color MenuItemSelectedGradientEnd {
get { return ColorTranslator.FromHtml("#404040"); }
}
public override Color ToolStripDropDownBackground {
get { return ColorTranslator.FromHtml("#232323"); }
}
public override Color ToolStripGradientBegin {
get { return ColorTranslator.FromHtml("#404040"); }
}
public override Color ToolStripGradientEnd {
get { return ColorTranslator.FromHtml("#404040"); }
}
public override Color ToolStripGradientMiddle {
get { return ColorTranslator.FromHtml("#404040"); }
}
public override Color SeparatorDark {
get { return AccentColor; }
}
Whats my problem im facing?