Dim tbc As WinForm.TabControl = e.Form.Controls("TabControl1")
Select Case e.Sender.Name
Case "报名管理"
For Each tbp As WinForm.TabPage In tbc.TabPages
If tbp.Name = e.Sender.Name Then
tbc.SelectedPage = tbp
Return
End If
Next
tbc.TabPages.Add(e.Sender.Name,e.Sender.Name)
Dim frm = Forms(e.Sender.Name)
frm.OPEN(-1000,-1500)
frm.BaseForm.TopLevel = False '窗口降级
frm.BaseForm.Dock = Windows.Forms.DockStyle.fill
frm.BaseForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
tbc.TabPages(e.Sender.Name).Controls.add(frm.BaseForm)
tbc.SelectedIndex = tbc.TabPages.Count-1
' tbc.SelectedPage.Image = getimage("D:\delete_16x16.gif")
Case "在职管理"
For Each tbp As WinForm.TabPage In tbc.TabPages
If tbp.Name = e.Sender.Name Then
tbc.SelectedPage = tbp
Return
End If
Next
tbc.TabPages.Add(e.Sender.Name,e.Sender.Name)
Dim frm = Forms(e.Sender.Name)
frm.OPEN(-1000,-1500)
frm.BaseForm.TopLevel = False '窗口降级
frm.BaseForm.Dock = Windows.Forms.DockStyle.fill
frm.BaseForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
tbc.TabPages(e.Sender.Name).Controls.add(frm.BaseForm)
tbc.SelectedIndex = tbc.TabPages.Count-1
' tbc.SelectedPage.Image = getimage("D:\delete_16x16.gif")
Case "教育管理"
For Each tbp As WinForm.TabPage In tbc.TabPages
If tbp.Name = e.Sender.Name Then
tbc.SelectedPage = tbp
Return
End If
Next
tbc.TabPages.Add(e.Sender.Name,e.Sender.Name)
Dim frm = Forms(e.Sender.Name)
frm.OPEN(-1000,-1500)
frm.BaseForm.TopLevel = False '窗口降级
frm.BaseForm.Dock = Windows.Forms.DockStyle.fill
frm.BaseForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
tbc.TabPages(e.Sender.Name).Controls.add(frm.BaseForm)
tbc.SelectedIndex = tbc.TabPages.Count-1
' tbc.SelectedPage.Image = getimage("D:\delete_16x16.gif")
Case "事故管理"
For Each tbp As WinForm.TabPage In tbc.TabPages
If tbp.Name = e.Sender.Name Then
tbc.SelectedPage = tbp
Return
End If
Next
tbc.TabPages.Add(e.Sender.Name,e.Sender.Name)
Dim frm = Forms(e.Sender.Name)
frm.OPEN(-1000,-1500)
frm.BaseForm.TopLevel = False '窗口降级
frm.BaseForm.Dock = Windows.Forms.DockStyle.fill
frm.BaseForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
tbc.TabPages(e.Sender.Name).Controls.add(frm.BaseForm)
tbc.SelectedIndex = tbc.TabPages.Count-1
' tbc.SelectedPage.Image = getimage("D:\delete_16x16.gif")
End Select
Case 内容有30来个, 怎么修改成调用函数的方式去使用