C# NavBarControl根据鼠标点击位置获取 NavBarGroup 对象
C# NavBarControl根据鼠标点击位置获取 NavBarGroup 对象
C# 全选
private void navBarControl1_Click(object sender, EventArgs e)
{
//根据鼠标点击位置获取 NavBarGroup 对象
if (e is System.Windows.Forms.MouseEventArgs)
{
System.Windows.Forms.MouseEventArgs ar = e as System.Windows.Forms.MouseEventArgs;
NavBarHitInfo info = navBarControl1.CalcHitInfo(ar.Location);
if (info is NavBarNavigationPaneHitInfo)
{
NavBarNavigationPaneHitInfo click = info as NavBarNavigationPaneHitInfo;
//NavBarGroup 对象
if (click.Group != null && click.InGroup && click.InLink == false)
{
if (navBarControl1.ActiveGroup != click.Group)
navBarControl1.ActiveGroup = click.Group;
else
//调用ActiveGroupChanged事件
navBarControl1_ActiveGroupChanged(navBarControl1, new NavBarGroupEventArgs(click.Group));
}
}
}
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网