日期:2014-05-18  浏览次数:21108 次

请问DotNetBar菜单怎么设置快捷键?
字母前面加&不可以,请问该怎么设置呢?

------解决方案--------------------
肯定是你的问题,你怎么加的?!
------解决方案--------------------
C# code

Bar bar=new Bar("Menu Bar");         bar.MenuBar=true;         bar.Stretch=true;         dotNetBarManager1.Bars.Add(bar);         bar.DockSide=eDockSide.Top;                  ButtonItem menu, submenu;         menu=new ButtonItem("bFile","&File");         bar.Items.Add(menu);         submenu=new ButtonItem("bOpen","&Open");         menu.SubItems.Add(submenu);         submenu=new ButtonItem("bClose","&Close");         menu.SubItems.Add(submenu);         submenu=new ButtonItem("bExit","&Exit");         submenu.BeginGroup=true;         menu.SubItems.Add(submenu);                  menu=new ButtonItem("bEdit","&Edit");         bar.Items.Add(menu);         submenu=new ButtonItem("bCut","&Cut");         menu.SubItems.Add(submenu);         submenu=new ButtonItem("bCopy","&Copy");         menu.SubItems.Add(submenu);         submenu=new ButtonItem("bPaste","&Paste");         menu.SubItems.Add(submenu);         submenu=new ButtonItem("bClear","&Clear");         submenu.BeginGroup=true;         menu.SubItems.Add(submenu);         bar.RecalcLayout();

------解决方案--------------------
加了&,要按Alt键才会出现快捷键提示.
------解决方案--------------------
首级菜单默认不是显示下划线的,要显示就按Alt,
如果你一定想要显示,可以用DNB的Markup语法
C# code
ButtonItem btn = new ButtonItem();
btn.Text = "<u>M</u>yButton";