参考论坛里的分享案例,能够实现T窗口菜单按钮打开abControl页签的功能。Itemclick代码是:
Dim tab As WinForm.TabControl = e.Form.Controls("TabControl1")
If Forms.contains(e.StripItem.Name) = False Then
MessageBox.Show("建设中……", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning)
Return
End If
For i As Integer = 0 To tab.TabPages.Count - 1
If tab.TabPages(i).Name = e.StripItem.Name Then
tab.SelectedIndex = i
Return
End If
Next
e.Form.StopRedraw
tab.TabPages.Add(e.StripItem.Name, e.StripItem.Name)
Forms(e.StripItem.Name).Open( - 1000, - 1500)
Forms(e.StripItem.Name).BaseForm.TopLevel = False
Forms(e.StripItem.Name).BaseForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Forms(e.StripItem.Name).BaseForm.Dock = System.Windows.Forms.DockStyle.Fill
Forms(e.StripItem.Name).BaseForm.AutoScroll = True
tab.TabPages(e.StripItem.Name).Controls.Add(Forms(e.StripItem.Name).BaseForm)
tab.SelectedPage = tab.TabPages(e.StripItem.Name)
BaseMainForm.Activate()
e.Form.ResumeRedraw
现在想通过选择导航栏内的页面,实现打开TabControl页签的功能。代码如何修改?谢谢!
参考案例:http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=179152&authorid=0&page=0&star=1