|
namespace ZetaHtmlEditControl
{
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
public class MyToolStripRender :
ToolStripProfessionalRenderer
{
protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
{
var mi = e.Item as ToolStripMenuItem;
if (mi != null)
{
e.TextColor = e.Text == getShortcutText(mi)
? SystemColors.GrayText
: SystemColors.MenuText;
}
base.OnRenderItemText(e);
}
private string getShortcutText(ToolStripMenuItem mi)
{
var t= (string)mi.GetType().InvokeMember(
@"GetShortcutText",
BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance,
null,
mi,
new object[] { });
return t;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.