Dim f As WinForm.Form = e.Form
Dim dtl As DataTable = DataTables("Customer")
'生成容器控件(分割面板)spl
Dim spl As WinForm.SplitContainer = f.CreateControl("spl", ControlTypeEnum.SplitContainer) '生成名为“spl”的SplitContainer
spl.Orientation = System.Windows.Forms.Orientation.Horizontal 'spl面板排列为水平排列
f.AddControl(spl)
spl.Dock = System.Windows.Forms.DockStyle.Fill '停靠为Fill
spl.SplitterDistance = spl.Height * 3 / 4 'spl的分隔条位于spl的3/4处
'生成主表
Dim tbl As WinForm.Table = f.CreateTable("tbl", dtl.Caption, True) '创建一个名为"tbl"的Table控件,并设置为副本
'将主表放入分割面板spl的面板1
spl.Panel1.AddControl(tbl) ‘这句代码报错“未将对象引用设置到对象的实例”
tbl.Dock = System.Windows.Forms.DockStyle.Fill '停靠为Fill
tbl.Table.DataSource = dtl
[此贴子已经被作者于2022/5/30 13:55:28编辑过]