实现一个增值功能,
在xtraTabbedMdiManager组件TabPage标题上右鍵弹出关闭当前窗体的菜单.
C#
Code:
private void xtraTabbedMdiManager1_MouseUp(object sender, MouseEventArgs
e)
{
if (e.Button !=
MouseButtons.Right) return;
BaseTabHitInfo
hint =
xtraTabbedMdiManager1.CalcHitInfo(e.Location);
if (hint.IsValid && (hint.Page
!= null))
{
if (xtraTabbedMdiManager1.SelectedPage.MdiChild
!= null)
{
Point
p =
xtraTabbedMdiManager1.SelectedPage.MdiChild.PointToScreen(e.Location);
menuStripCloseForm.Show(p);
}
}
}
菜单事件:
C#
Code:
private void menuItemCloseWindow_Click(object sender, EventArgs
e)
{
xtraTabbedMdiManager1.SelectedPage.MdiChild.Close();
}
xtraTabbedMdiManager的标题上右鍵弹出关闭窗体菜单,布布扣,bubuko.com
xtraTabbedMdiManager的标题上右鍵弹出关闭窗体菜单
原文:http://www.cnblogs.com/eastson/p/3781197.html