此主题相关图片如下:qq截图20181118100006.png
运行出错,错在哪里呢???
函数 ”加入窗体“
Dim PB As WinForm.Panel = args(0)
Dim frmName As String=args(1)
Forms(frmName).OPEN(-1000,-1000)
Forms(frmName).BaseForm.TopLevel = False
Forms(frmName).BaseForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Forms(frmName).BaseForm.Dock = System.Windows.Forms.DockStyle.Fill
PB.BaseControl.Controls.Clear
PB.BaseControl.Controls.add(Forms(frmName).BaseForm)
--------------------------------------------------------------
’窗体里的代码
Select Case e.Sender.text
Case "快递查询","天气预报","违章查询","证件查验","OpenQQ","Excel编辑"
e.Form.StopRedraw()
Dim tcpg As WinForm.TabPage
tcpg=Tc.TabPages.Insert("TC" & e.Sender.Name,e.Sender.Name.SubString(4),Tc.TabPages.Count) '动态添加一个页面
Dim pl As WinForm.panel
pl=e.Form.CreateControl("pl" & e.Sender.Name, ControlTypeEnum.panel) '动态添加一个panel
tcpg.AddControl(pl)
pl.Dock = System.Windows.Forms.DockStyle.Fill
Functions.Execute("加入窗体",pl,e.Sender.text)
e.Form.ResumeRedraw()
end select