我正在尝试创建一个 DevEx 下拉按钮。不幸的是,我遇到了两个我无法弄清楚的问题:
1) 我无法正确设置弹出菜单的外观,即它的外观不是“Office 2010 Blue”。我正在使用的代码如下所示:
private void InitializeSendToPricingSheetButton()
{
var barManager = new BarManager();
if (barManager.Controller == null) barManager.Controller = new BarAndDockingController();
barManager.Controller.PaintStyleName = "Skin";
barManager.Controller.LookAndFeel.UseDefaultLookAndFeel = false;
barManager.Controller.LookAndFeel.SkinName = "Office 2010 Blue";
barManager.ItemClick += HandleSendToPricingSheetClick;
barManager.Items.AddRange(new[] { new BarButtonItem(barManager, "Foo"), new BarButtonItem(barManager, "Bar"), new BarButtonItem(barManager, "Baz") });
var popupMenu = new PopupMenu { Manager = barManager };
foreach (var barItem in barManager.Items) popupMenu.ItemLinks.Add((BarItem)barItem);
popupMenu.ItemLinks[1].BeginGroup = true;
dropDownButtonSendToPricingSheet.DropDownControl = popupMenu;
}
2) 此按钮位于表单上。如果表单失去焦点(例如,我单击 Firefox),弹出菜单仍然保持在顶部。在点击之前它不会消失。
任何建议将不胜感激。感谢您帮助我处理 DevEx 的疯狂问题。