DevExpress NavBarControl控件鼠标左键单击Group实现Expanded(NavBarGroup触发展开或者折叠事件?)

相应narBarControl控件的 MouseDown事件,代码如下:

 private void navBarControl1_MouseDown_1(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                DevExpress.XtraNavBar.NavBarControl navBar = sender as DevExpress.XtraNavBar.NavBarControl;
                DevExpress.XtraNavBar.NavBarHitInfo hitInfo = navBar.CalcHitInfo(new Point(e.X, e.Y));
                if (hitInfo.InGroupCaption && !hitInfo.InGroupButton)
                    hitInfo.Group.Expanded = !hitInfo.Group.Expanded;
            }
        }

你可能感兴趣的:(DevExpress NavBarControl控件鼠标左键单击Group实现Expanded(NavBarGroup触发展开或者折叠事件?))