打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
navBarControl xtratabbedmanager
1. form 设置为 private 始终 只打开一个2.NavBarControl尝试设置Item的属性LargeImageIndex的值,则发现没有任何变化,这是为什么呢?原来在设置这个属性之前还需要设置此Item所在Group的属性GroupStyle的值为LargeImageText。3. xtraTabbedMdiManager1.SelectedPage = xtraTabbedMdiManager1.Pages[f1]; // 选中page xtraTabbedMdiManager1.Pages[f1].Image = navBarItem1.SmallImage;// page设置图片 this.xtraTabbedMdiManager1.ClosePageButtonShowMode = DevExpress.XtraTab.ClosePageButtonShowMode.InAllTabPagesAndTabControlHeader; 4. 双击保存using DevExpress.XtraTabbedMdi;using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApplication15{ public partial class Form1 : Form { public Form1() { InitializeComponent(); xtraTabbedMdiManager1.MdiParent = this; } private void navBarControl1_Click(object sender, EventArgs e) { Form2 f1 = Form2.CreateFrom(); f1.MdiParent = this; f1.Show(); xtraTabbedMdiManager1.SelectedPage = xtraTabbedMdiManager1.Pages[f1]; xtraTabbedMdiManager1.Pages[f1].Image = navBarItem1.SmallImage; } private void navBarItem2_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { Form3 f1 = Form3.CreateForm(); f1.MdiParent = this; f1.Show(); xtraTabbedMdiManager1.SelectedPage = xtraTabbedMdiManager1.Pages[f1]; xtraTabbedMdiManager1.Pages[f1].Image = navBarItem1.SmallImage; } private DateTime m_LastClick = System.DateTime.Now; private XtraMdiTabPage m_lastPage = null; private void xtraTabbedMdiManager1_MouseDown(object sender, MouseEventArgs e) { XtraMdiTabPage curPage = (sender as XtraTabbedMdiManager).SelectedPage; if (e.Button == MouseButtons.Left) { DateTime dt = DateTime.Now; TimeSpan span = dt.Subtract(m_LastClick); if (span.TotalMilliseconds < 300) //如果两次点击的时间间隔小于300毫秒,则认为是双击 { if (this.MdiChildren.Length > 1) { // 限制只有在同一个页签上双击才能关闭.(规避两个页签切换时点太快导致意外关闭页签) if (curPage.Equals(m_lastPage)) { //if (this.ActiveMdiChild != m_MapForm) //{ //this.ActiveMdiChild.Close(); curPage.MdiChild.Close(); //} } } m_LastClick = dt.AddMinutes(-1); } else { m_LastClick = dt; m_lastPage = curPage; } } } private void Form1_Load(object sender, EventArgs e) { } }}/*************/ form using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApplication15{ public partial class Form2 : Form { private Form2() { InitializeComponent(); } private static Form2 instance; public static Form2 CreateFrom() { //判断是否存在该窗体,或时候该字窗体是否被释放过,如果不存在该窗体,则 new 一个字窗体 if (instance == null || instance.IsDisposed) { instance = new Form2(); } return instance; } private void Form2_Load(object sender, EventArgs e) { } }}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
StatusStrip状态栏控件
V8.7 Timer控件 播放多媒体
使用C#选择文件夹、打开文件夹、选择文件
C# Web Browser控件浅析 - 51CTO.COM
C# 数字转换
求助
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服