tabcontrol加载窗体后原窗体内的控件鼠标操作
将窗体加载到tabcontrol后,窗体上的textbox等控件的text文本内容 无法使用鼠标右键,或者拖动选择,不加载到tabcontrol就不会有这个问题,请教各位高手,是哪里还需要设置
Visual Basic code? Public Class Form1 Private Sub TextToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextToolStripMenuItem.Click Dim mytab As New TabPage() mytab.Text = TextToolStripMenuItem.Text TabControl1.TabPages.Add(mytab) Me.TabControl1.SelectedTab = mytab Dim form As New Form2 form.TopLevel = False mytab.Controls.Add(form) form.Show() form.Dock = DockStyle.Fill End Sub Private Sub Text1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 接待方案 Text1ToolStripMenuItem.Click Form2.Show() End SubEnd Class
添加ContextMenuStrip控件
终于搞定,加入下面一行代码ok
newform.FormBorderStyle = FormBorderStyle.None