gpt4 book ai didi

colors - 如何更改工具条菜单项边框颜色?

转载 作者:行者123 更新时间:2023-12-01 03:58:37 27 4
gpt4 key购买 nike

我做了一个这样的表格(语言 c# - VisualStudio2012):
http://i.stack.imgur.com/5GEY1.jpg
如何将 toolstripmenuitem 的边框颜色从白色更改为另一种颜色,或禁用它?
代码:

class CustomProfessionalColors : ProfessionalColorTable
{
public override Color MenuItemSelected
{ get { return Color.FromArgb(51, 51, 52); } }

public override Color MenuBorder
{ get { return Color.Black; } }

//fill màu item của menu khi mouse enter
public override Color MenuItemSelectedGradientBegin
{ get { return Color.FromArgb(64, 64, 66); } }

public override Color MenuItemSelectedGradientEnd
{ get { return Color.FromArgb(64, 64, 66); } }

// chọn màu viền menu item khi mouse enter
public override Color MenuItemBorder
{ get { return Color.FromArgb(51, 51, 52); } }

// fill màu nút item của menu khi dc nhấn
public override Color MenuItemPressedGradientBegin
{ get { return Color.FromArgb(27, 27, 28); } }

public override Color MenuItemPressedGradientEnd
{ get { return Color.FromArgb(27, 27, 28); } }

// fill màu thanh menu strip
public override Color MenuStripGradientBegin
{ get { return Color.FromArgb(51, 51, 52); } }

public override Color MenuStripGradientEnd
{ get { return Color.FromArgb(51, 51, 52); } }
}

public Form1()
{
InitializeComponent();
menuStrip1.Renderer = new ToolStripProfessionalRenderer(new CustomProfessionalColors());
}

最佳答案

这将完成工作。
它实际上不是边框,而是背景。

public override Color ToolStripDropDownBackground {
get { return Color.Red; }
}

关于colors - 如何更改工具条菜单项边框颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15207460/

27 4 0