代码如下
If e.Form.ExistControl("Table1")=0 Then
Dim tbl As WinForm.Table
tbl = e.Form.CreateTable("Table1", "销售订单", True)
tbl.SetBounds(6, 330, 663, 250)
e.Form.Controls("SplitContainer1").Panel2.AddControl(tbl)
Tables("销售订单").AddNew()
Else
Tables("销售订单").DataTable.Load(False)
e.Form.Controls("SplitContainer1").Panel2.removeControl("Table1")
Dim tbl As WinForm.Table
tbl = e.Form.CreateTable("Table1", "销售订单", True)
tbl.SetBounds(6, 330, 663, 250)
e.Form.Controls("SplitContainer1").Panel2.AddControl(tbl)
Tables("销售订单").AddNew()
End If