private void btnChangeTabName_Click(object sender, EventArgs e) { tabTitleChange = new TitleChange(); tabTitleChange.Text = "更改标签页名称"; tabTitleChange.txtTitle.Text = mMainForm.tabControl.SelectedTab.Text; tabTitleChange.btnSave.Click += new EventHandler(tabTitleChangebtnSave_Click); tabTitleChange.Show(); }
//重写标题栏双击事件 protected override void WndProc(ref System.Windows.Forms.Message m) { const int WM_NCLBUTTONDBLCLK = 0xA3; switch (m.Msg) { case WM_NCLBUTTONDBLCLK: if (GlobalVar.editFlag) { mTitleChange = new TitleChange(); mTitleChange.txtTitle.Text = GlobalVar.sMainFormTitle; mTitleChange.Text = "更改窗口名称"; mTitleChange.btnSave.Click += new EventHandler(mTitleChange_btnSave_Click); mTitleChange.Show(); } break; default: base.WndProc(ref m); // 调用基类函数处理其他消息 break; } }