日期:2014-05-18 浏览次数:21108 次
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语法
ButtonItem btn = new ButtonItem(); btn.Text = "<u>M</u>yButton";