Foxtable(狐表)用户栏目专家坐堂 → 请问下在窗口设计里,怎么用代码隐藏显示列


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

主题:请问下在窗口设计里,怎么用代码隐藏显示列

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


加好友 发短信
等级:超级版主 帖子:521 积分:4910 威望:0 精华:7 注册:2008/9/2 22:22:00
  发帖心情 Post By:2011/6/20 13:47:00 [显示全部帖子]

显示:

Dim chk As WinForm.CheckBox
For n As Integer = 1 To 10   'n的最大值根据实际情况设定
    chk= e.Form.Controls("CheckBox" & n)
    Tables("表A").Cols( chk.Text).Visible =  chk.Checked  
Next

隐藏:
Dim chk As WinForm.CheckBox
For n As Integer = 1 To 10
    chk= e.Form.Controls("CheckBox" & n)
    Tables("表A").Cols( chk.Text).Visible = Not chk.Checked  
Next

撤销:
Dim chk As WinForm.CheckBox
For n As Integer = 1 To 10
    chk= e.Form.Controls("CheckBox" & n)
    Tables("表A").Cols( chk.Text).Visible =  True
Next


[此贴子已经被作者于2011-6-20 16:02:10编辑过]

 回到顶部