Dim e As FormEventArgs = Args(0)
Dim split As WinForm.SplitContainer
Dim pnl,pnl1 As WinForm.Panel
With e.form
' 创建split分隔
split = .CreateControl("split1", ControlTypeEnum.splitcontainer)
split.Dock = Windows.Forms.DockStyle.Fill
split.Orientation = 0
split.splitterwidth = 1
split.backcolor= Color.FromARGB(192,192,192)
split.IsSplitterFixed = False
e.form.addcontrol(split)
split.SplitterDistance = 100
'创建panel工具栏
pnl = .CreateControl("pnl1", ControlTypeEnum.panel)
pnl.Dock = Windows.Forms.DockStyle.Fill
split.panel1.AddControl(pnl)
pnl.Topmost = True
'创建第二个Panel
pnl1 = .CreateControl("pnl1", ControlTypeEnum.panel)
pnl1.Dock = Windows.Forms.DockStyle.Fill
split.panel2.AddControl(pnl1)
pnl1.Topmost = True
End With
---------函数写在窗口加载事件中生成上面的控件。
现在我想加用函数向生成的pnl,pnl1
生成一个LABEL在Pnl
生成一个botton在pnl1
我该如何在另外的函数向这个函数生成的容器指定对象呢。