做了一个liform的内部函数,用于内嵌窗口,代码如下:
Dim Panel As WinForm.Panel = Args(0) '窗口容器
Dim Form As WinForm.Form = Forms(Args(1)) '要加载的窗口
Form.Show(-1000,-1500)
Form.BaseForm.TopLevel = False
Form.BaseForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Form.BaseForm.Dock = System.Windows.Forms.DockStyle.Fill
Panel.BaseControl.Controls.Clear
Panel.BaseControl.Controls.add(Form.BaseForm)
主窗口新建了3个button,
主窗口的afterload事件上,用PerformClick做了触发:
Dim bt1 As WinForm.Button = e.Form.Controls("Button1")
bt1.PerformClick
Dim bt2 As WinForm.Button = e.Form.Controls("Button2")
bt2.PerformClick
Dim bt3 As WinForm.Button = e.Form.Controls("Button3")
bt3.PerformClick
第一个button,就是调用liform函数
Functions.Execute("liform",e.Form.Controls("Panel1"),"产品筛选窗口")
’Functions.Execute("liform",e.Form.Controls("Panel2"),"分页窗口")
问题是:主窗体上有2个panel,需要分别调用2个内嵌窗口,但两个内嵌窗口都用liform调用的时候,button2和button3的performclick事件触发不了,如果只调用一次liform,button2和button3的performclick是正常的,请教老师,这是什么原因呢?
此主题相关图片如下:qq截图20210615210529.png