以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  CateStydy目录下的文件:窗口动态列表项目.table有下面代码能改么?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=178577)

--  作者:初学FT
--  发布时间:2022/7/11 3:50:00
--  CateStydy目录下的文件:窗口动态列表项目.table有下面代码能改么?

CateStydy目录下的文件:窗口动态列表项目.table有下面代码:

1、在窗口的AfterLoad事件中加入代码:

Dim cmb As WinForm.ComboBox = e.form.Controls("ComboBox1")
cmb.ComboList =
DataTables("表A").GetComboListString("型号")

2、在ComboBox2的Enter事件中加入代码:

Dim cmb As WinForm.ComboBox = e.Sender
Dim
str As string = e.Form.Controls("ComboBox1").Value
cmb.ComboList =
DataTables("表A").GetComboListString("规格", "型号 = \'" & str & "\'"
)

3、最后在ComboBox3的Enter事件中加入代码:

Dim cmb As WinForm.ComboBox = e.Sender
Dim
str As String = e.Form.Controls("ComboBox2").Value
cmb
.ComboList = DataTables("表A").GetComboListString("颜色", "规格 = \'" & str & "\'"
)

如果把ComboBox3,换成控件CheckedComboBox1,褐色部分的代码怎么改,我生搬硬套了一下,

出现报错:无法将类型为“Foxtable.WinForm.CheckedComboBox”的对象强制转换为类型“Foxtable.WinForm.ComboBox”。


--  作者:有点蓝
--  发布时间:2022/7/11 8:41:00
--  
Dim cmb As WinForm.CheckedComboBox e.Sender
--  作者:初学FT
--  发布时间:2022/7/11 9:01:00
--  
报错:Sender "不是"FormEventArgs”的成员。
--  作者:有点蓝
--  发布时间:2022/7/11 9:19:00
--  
没有放对事件,这个要放到控件的enter事件。