运行表A的"工资"窗口,点右边的"公式管理",下边的textbox不显示表中相应内容,见下面倒数第二句.
Dim tr As WinForm.TreeView = Forms("工资").Controls("TreeView1")
Dim nd As WinForm.TreeNode = tr.SelectedNode
e.form.SetBounds(20, 30, 1000, 600) '调整窗口大小
Dim tbl1 As WinForm.Table '定义第一个表
tbl1 = e.Form.CreateTable("Table1", "公式表", True) ' true 代表副本,False代表
normal类型
tbl1.SetBounds(30, 55, 950, 340)
e.Form.AddControl(tbl1)
Tables("工资加列_table1").Filter = "[表名] = '" & nd.text & "' And [zt] = '" &
vars("账套") & "' And [设置] = '公式'"
Tables("工资加列_table1").SetColVisibleWidth("表名|100|公式内容|900")
If Tables("公式表").rows.count=0
Dim dr1 As Row = Tables("公式表").AddNew
dr1("表名") = nd.text
dr1("zt") = vars("账套")
dr1("设置") = "公式"
End If'
Dim txt As WinForm.TextBox '定义输入框
txt = e.Form.CreateControl("TextBox2", ControlTypeEnum.TextBox)
txt.MultiLine=True '设置多行文本
txt.SetBounds(30, 500, 950, 40)
txt.BindingField = "工资加列_table1.公式内容"
e.Form.AddControl(txt)