你好
这张图总结了:
遇到麻烦,无法使用搜索栏找到合适的答案。我尝试使用自定义渲染,但是当我使用System Render作为menustrip时,它总是只用于专业渲染。
编辑:发现自己
public class CustomColorTable : ProfessionalColorTable
{
public override Color MenuItemSelected
{
get { return Color.FromArgb(51,153,255); }
}
public override Color ToolStripDropDownBackground
{
get { return Color.FromArgb(83, 83, 83); }
}
public override Color ImageMarginGradientBegin
{
get { return Color.FromArgb(83, 83, 83); }
}
public override Color ImageMarginGradientEnd
{
get { return Color.FromArgb(83, 83, 83); }
}
public override Color ImageMarginGradientMiddle
{
get { return Color.FromArgb(83,83,83); }
}
public override Color MenuItemSelectedGradientBegin
{
get { return Color.FromArgb(51, 153, 255); }
}
public override Color MenuItemSelectedGradientEnd
{
get { return Color.FromArgb(51, 153, 255); }
}
public override Color MenuItemPressedGradientBegin
{
get { return Color.FromArgb(51, 153, 255); }
}
public override Color MenuItemPressedGradientMiddle
{
get { return Color.FromArgb(51, 153, 255); }
}
public override Color MenuItemPressedGradientEnd
{
get { return Color.FromArgb(51, 153, 255); }
}
public override Color MenuItemBorder
{
get { return Color.FromArgb(51, 153, 255); }
}
}
然后只需使用新的colortable:
MS1.Renderer = new ToolStripProfessionalRenderer(new CustomColorTable()); ;