Foxtable(狐表)用户栏目专家坐堂 → 多个复选框CheckBox的设置保存与调用


  共有2232人关注过本帖树形打印复制链接

主题:多个复选框CheckBox的设置保存与调用

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/8 8:41:00 [显示全部帖子]

Dim pth As String = ProjectPath & "Syscm\用户设置\" '设置保存路径
Dim nms() As String = {"sgchk","jlchk","zjchk"}
Dim cvs As String = ""
For Each nm As String In nms
    cvs &=  e.Form.Controls(nm).Checked & chr(11)
Next
Dim form As String = e.Form.name
Dim dd As String = pth & form & ".txt"
FileSys.WriteAllText(dd, cvs.trim(chr(11)), False, Encoding.Default)

 

-----------------------------

 

Dim pth As String = ProjectPath & "Syscm\用户设置\" '设置保存路径
Dim form As String = e.Form.name
Dim dd As String = pth & form & ".txt"
Dim cvs() As String = FileSys.ReadAllText(dd,Encoding.Default).split(chr(11))
Dim nms() As String = {"sgchk","jlchk","zjchk"}
If cvs.length = nms.length Then
    For i As Integer = 0 To nms.length-1
        e.Form.Controls(nms(i)).Checked = cvs(i)
    Next
End If

[此贴子已经被作者于2017/11/8 10:30:29编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/8 12:45:00 [显示全部帖子]

Dim pth As String = ProjectPath & "Syscm\用户设置\" '设置保存路径
Dim nms() As String = {"Table1","Table2","项Table3"}
Dim cvs As String = ""
For Each nm As String In nms
    cvs &=  e.Form.Controls(nm).Table.GetColVisibleWidth & chr(11)
Next
Dim form As String = e.Form.name
Dim dd As String = pth & form & ".txt"
FileSys.WriteAllText(dd, cvs.trim(chr(11)), False, Encoding.Default)

 

-----------------------------

 

Dim pth As String = ProjectPath & "Syscm\用户设置\" '设置保存路径
Dim form As String = e.Form.name
Dim dd As String = pth & form & ".txt"
Dim cvs() As String = FileSys.ReadAllText(dd,Encoding.Default).split(chr(11))
Dim nms() As String = {"Table1","Table2","Table3"}
If cvs.length = nms.length Then
    For i As Integer = 0 To nms.length-1
        e.Form.Controls(nms(i)).Table.SetColVisibleWidth(cvs(i))
    Next
End If


 回到顶部