以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 内部函数问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=133962) |
-- 作者:ifox2018 -- 发布时间:2019/4/24 11:08:00 -- 内部函数问题 借用的其他帖子里的源码: 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来个, 怎么修改成调用函数的方式去使用 |
-- 作者:有点甜 -- 发布时间:2019/4/24 11:50:00 -- 函数改成
Dim e = args(0)
然后直接调用即可,如
Functions.Execute("test", e) [此贴子已经被作者于2019/4/24 11:50:23编辑过]
|