以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]动态窗口控件  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=121413)

--  作者:lgj716330
--  发布时间:2018/7/5 16:26:00
--  [求助]动态窗口控件

动态窗口控件的动态列表项目设置,以下代码没起作用

 

Dim lbl As WinForm.CheckedComboBox 
 lbl = e.Form.CreateControl("DL", ControlTypeEnum.CheckedComboBox) 
 lbl.Left = 100
 lbl.Top = 70
 lbl.Width = 100
 lbl.Height = 20
 e.Form.AddControl(lbl)

 

Dim lbl1 As WinForm.CheckedComboBox 
 lbl1 = e.Form.CreateControl("MX", ControlTypeEnum.CheckedComboBox) 
 lbl1.Left = 210
 lbl1.Top = 70
 lbl1.Width = 100
 lbl1.Height = 20
 e.Form.AddControl(lbl1)


Dim DL As String
If e.Form.ExistControl("DL") = True 
    Dim cmb As WinForm.CheckedComboBox = e.form.Controls("DL") 
    cmb.ComboList = DataTables("科目档案").GetComboListString("成本大类")
    Dim cmb1 As WinForm.CheckedComboBox = e.form.Controls("MX")
    Dim str1 As String = e.Form.Controls("DL").value 
    If str1 Is Nothing
        cmb1.ComboList = DataTables("科目档案").GetComboListString("科目名称","科目性质=\'损益\'")
        Else
        cmb1.ComboList = DataTables("科目档案").GetComboListString("科目名称","成本大类 in ( \'" & str1.replace(",","\',\'") & "\')") 
    End If
End If

 

上面标颜色的这句代码没起作用,如果直接放在控件的enter事件里是没有问题的


--  作者:有点蓝
--  发布时间:2018/7/5 17:01:00
--  
这个返回什么数据:

msgbox(DataTables("科目档案").GetComboListString("科目名称","成本大类 in ( \'" & str1.replace(",","\',\'") & "\')") )

msgbox("成本大类 in ( \'" & str1.replace(",","\',\'") & "\')")

--  作者:lgj716330
--  发布时间:2018/7/5 18:02:00
--  

试了,放在控件的enter事件里显示正常

我上面的代码是写在单选按钮的click事件里的,msgbox没显示任何东西

如何将控件的enter事件在click事件里体现呢

 


--  作者:有点甜
--  发布时间:2018/7/5 22:12:00
--  

我这样测试,正常,请做个例子发上来测试。

 

Dim lbl As WinForm.CheckedComboBox
lbl = e.Form.CreateControl("DL", ControlTypeEnum.CheckedComboBox)
lbl.Left = 100
lbl.Top = 70
lbl.Width = 100
lbl.Height = 20
e.Form.AddControl(lbl)

Dim lbl1 As WinForm.CheckedComboBox
lbl1 = e.Form.CreateControl("MX", ControlTypeEnum.CheckedComboBox)
lbl1.Left = 210
lbl1.Top = 70
lbl1.Width = 100
lbl1.Height = 20
e.Form.AddControl(lbl1)


Dim DL As String
If e.Form.ExistControl("DL") = True
    Dim cmb As WinForm.CheckedComboBox = e.form.Controls("DL")
    cmb.ComboList = "1|2|3|4"
    Dim cmb1 As WinForm.CheckedComboBox = e.form.Controls("MX")   
    cmb1.ComboList = "A|B"
End If


--  作者:lgj716330
--  发布时间:2018/7/6 9:02:00
--  
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目5.foxdb


--  作者:有点甜
--  发布时间:2018/7/6 9:38:00
--  

如果你要做联动,必须在控件CheckedComboBox的enter、textchanged、或者click事件写代码才行的。

 

 


--  作者:lgj716330
--  发布时间:2018/7/7 17:17:00
--  

 哦,那我只有固定控件,用Visible属性控制了