Navbarcontrol auto在Devexpress中通过MouseHover或MouseEnter事件进行扩展

时间:2015-07-28 19:34:29

标签: c# winforms devexpress

我在Winform中遇到Devexpress 13.1.8的问题是:当光标位于NavbarGroup上时,我想要NavbarGroup自动展开。我想我必须抓住老鼠的事件,但我不知道如何。
那么,我该怎么做呢?
对不起,我的英语不好。
谢谢你们所有人。

2 个答案:

答案 0 :(得分:0)

我相信你应该从阅读文档开始:Obtain Hit Information

How to: Get the Group That Is Hovered Over帮助文章提供的示例演示了适合您的方法: 使用DevExpress.XtraNavBar;

void navBarControl1_MouseMove(object sender, MouseEventArgs e) {
   NavBarHitInfo hitInfo = navBarControl1.CalcHitInfo(e.Location);
   if (hitInfo.InGroup) {
      NavBarGroup group = hitInfo.Group;
      // perform operations on the group here
      //...
   }
}

答案 1 :(得分:0)

首先,你应该通过Expand and Collapse Groups,然后你需要让NavBarGroup徘徊与否。您可以在@MmitryG已经建议的DevExpress example How to: Get the Group That Is Hovered Over中所述的MouseMove事件的处理程序上进行检查。

NSUUID().UUIDString

<强>参考文献:
Which event to use when collapsing/expanding the groups in the NavBar's Explorer views?
How to expand NavBar groups by clicking their captions
XtraNavBar expand one group only