Foxtable(狐表)用户栏目专家坐堂 → [求助]请教关于判断选定多个复选框的问题


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

主题:[求助]请教关于判断选定多个复选框的问题

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/5/22 15:20:00 [显示全部帖子]

Dim t As Table = CurrentTable
For Each c As Col In t.Cols
    c.visible = False
Next
Dim i As Integer = 0
If forms("指定显示列").Controls("CheckBox1").checked=True Then
    t.Cols("第一列").visible = True
    t.Cols("第二列").visible = True
    i += 1
End If
If forms("指定显示列").Controls("CheckBox2").checked=True Then
    t.Cols("第三列").visible = True
    t.Cols("第四列").visible = True
    i += 1
End If
If forms("指定显示列").Controls("CheckBox3").checked=True Then
    t.Cols("第五列").visible = True
    t.Cols("第六列").visible = True
    i += 1
End If
If forms("指定显示列").Controls("CheckBox4").checked=True Then
    t.Cols("第七列").visible = True
    t.Cols("第八列").visible = True
    i += 1
End If
If i > 1 Then
    t.Cols("合计").visible = True
End If

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/5/23 18:04:00 [显示全部帖子]

Dim t As Table = CurrentTable
For Each c As Col In t.Cols
    c.visible = False
Next
Dim i As Integer = 0
If forms("指定显示列").Controls("CheckBox1").checked=True Then
    t.Cols("第一列").visible = True
    t.Cols("第二列").visible = True
    i=i+1
End If
If forms("指定显示列").Controls("CheckBox2").checked=True Then
    t.Cols("第三列").visible = True
    t.Cols("第四列").visible = True
    i=i+1
End If
If forms("指定显示列").Controls("CheckBox3").checked=True Then
    t.Cols("第五列").visible = True
    t.Cols("第六列").visible = True
    i=i+1
End If
If forms("指定显示列").Controls("CheckBox4").checked=True Then
    t.Cols("第七列").visible = True
    t.Cols("第八列").visible = True
    i =i + 1
End If
If i > 1 Then
    DataTables("表a").datacols("第一列").RaiseDataColChanged
    t.Cols("合计").visible = True
End If

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/5/24 12:25:00 [显示全部帖子]

systemready = False
For Each dr As DataRow In DataTables("表B").DataRows
    Dim cls() As String = {"第一列","第二列","第三列","第四列","第五列","第六列","第七列","第八列"}
    Dim sum As Integer = 0   
    For Each c As String In cls       
        sum += dr(c)
    Next
    dr("合计") = sum
Next
systemready = True

 回到顶部