以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]控件保存存在的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=146394)

--  作者:blsu33
--  发布时间:2020/2/22 21:33:00
--  [求助]控件保存存在的问题
老师,
控件绑定表列,控件对应的内容,控件绑定,文本、数值、逻辑;但是控件本身不一定是文本、数值、逻辑,例如
{"FileManager","PictureViewer","BarCode"}这三种控件

下列代码,当循环表中控件,将值写入表中,标注颜色的部分,就会报错,上述三种控件貌似不是TEXT,应该怎么写?
 For Each nb As object In pnl.Children
        If nb.Bindingfield > "" Then
            tb=nb.BindingField.Split(".")(0)
            cl=nb.BindingField.Split(".")(1)
            If Tables(tb).Current IsNot Nothing Then
                Dim c As Col = Tables(tb).Cols(cl)
                If c.IsBoolean Then
                    Tables(tb).Current(cl)=nb.checked
                ElseIf c.IsNumeric Then
                    Tables(tb).Current(cl)=nb.value
                Else
                    Tables(tb).Current(cl)=nb.text
                End If
                Tables(tb).FinishEditing
            End If
        End If
    Next



--  作者:liufucan
--  发布时间:2020/2/22 22:41:00
--  
既然已经绑定,直接保存就是
--  作者:有点蓝
--  发布时间:2020/2/23 20:41:00
--  
既然都绑定了,为什么还要手工赋值?


如:If Typeof c Is WinForm.TextBox Then \'判断控件是否是文本框