以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  多个复选框CheckBox的设置保存与调用  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=109260)

--  作者:有点甜
--  发布时间: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编辑过]

--  作者:有点甜
--  发布时间: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