原来:
Dim txt As WinForm.TextBox
txt = e.Form.CreateControl("TextBox1", ControlTypeEnum.TextBox)
txt.Left = 100
txt.Top = 100
txt.BindingField = "订单.数量"
e.Form.AddControl(txt)
现在必须:
Dim txt As WinForm.TextBox
txt = e.Form.CreateControl("TextBox1", ControlTypeEnum.TextBox)
txt.Left = 100
txt.Top = 100
e.Form.AddControl(txt)
txt.BindingField = "订单.数量" '必须先将控件加入到窗口或容器中,才能设置绑定字段
提示:动态生成控件的时候,必须先将控件加入到窗口或容器中,才能设置其绑定字段,切记切记。
[此贴子已经被作者于2012-11-19 12:07:12编辑过]