最後我發現我寫這個代碼添加到的MenuStrip這個框架的方式...
:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ModernUISample.metro
{
/// <summary>
/// Menustrip for ModernUI-GUIs
/// </summary>
public class MetroMenuStrip : System.Windows.Forms.MenuStrip
{
/// <summary>
/// Constructor
/// </summary>
public MetroMenuStrip()
: base()
{
Renderer = new metroToolStripRenderer();
Font = MetroUI.Style.BaseFont;
ForeColor = MetroUI.Style.ForeColor;
}
/// <summary>
/// OnItemAdded-Event we adjust the font and forecolor of this item
/// </summary>
/// <param name="e"></param>
protected override void OnItemAdded(System.Windows.Forms.ToolStripItemEventArgs e)
{
base.OnItemAdded(e);
e.Item.Font = MetroUI.Style.BaseFont;
e.Item.ForeColor = MetroUI.Style.ForeColor;
}
}
}
在項目中創建一個文件。 並在此文件中創建類爲「MetroMenuStrip.cs」
並使用此代碼。
你能以編程方式引用類型嗎?也許你的工具箱視圖是[stale](http://stackoverflow.com/q/1212397/622391)。 –
你可以用詳細而廣泛的形容你的問題嗎?編輯你的問題將是受歡迎的:-) – zx485
我需要在Metro選項卡中添加更多工具。有太多的工具,但我只有20。 –