| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1788 人关注过本帖
标题:清空下一页键值
只看楼主 加入收藏
zlm091674
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2017-4-23
结帖率:66.67%
收藏
已结贴  问题点数:20 回复次数:5 
清空下一页键值
        Private Sub Command2_Click()
         D02.hide
         Gfct1.show

        Gfct1.Check1.Value = 0
        Gfct1.Check2.Value = 0
        Gfct1.Check3.Value = 0
        Gfct1.Check4.Value = 0
        Gfct1.Check5.Value = 0
        Gfct1.Check6.Value = 0
        Gfct1.Check7.Value = 0
        Gfct1.Check8.Value = 0
        Gfct1.Check9.Value = 0
        
        Gfct2.Check1.Value = 0
        Gfct2.Check2.Value = 0
        Gfct2.Check3.Value = 0
        Gfct2.Check4.Value = 0
        Gfct2.Check5.Value = 0
        Gfct2.Check6.Value = 0
        Gfct2.Check7.Value = 0
        Gfct2.Check8.Value = 0
        Gfct2.Check9.Value = 0
        
        GFct3.Check1.Value = 0
        GFct3.Check2.Value = 0
        GFct3.Check3.Value = 0
        GFct3.Check4.Value = 0
        GFct3.Check5.Value = 0
        GFct3.Check6.Value = 0
        GFct3.Check7.Value = 0
        GFct3.Check8.Value = 0
        GFct3.Check9.Value = 0
        
        Gfct4.Check1.Value = 0
        Gfct4.Check2.Value = 0
        Gfct4.Check3.Value = 0
        Gfct4.Check4.Value = 0
        Gfct4.Check5.Value = 0
        Gfct4.Check6.Value = 0
        Gfct4.Check7.Value = 0
        Gfct4.Check8.Value = 0
        Gfct4.Check9.Value = 0
        
        gfct5.Check1.Value = 0
        gfct5.Check2.Value = 0
        gfct5.Check3.Value = 0
        gfct5.Check4.Value = 0
        gfct5.Check5.Value = 0
        gfct5.Check6.Value = 0
        gfct5.Check7.Value = 0
        gfct5.Check8.Value = 0
        gfct5.Check9.Value = 0
        gfct5.Check10.Value = 0
        gfct5.Check11.Value = 0
        gfct5.Check12.Value = 0
        gfct5.Check13.Value = 0
        gfct5.Check14.Value = 0
        gfct5.Check15.Value = 0
        gfct5.Check16.Value = 0
        gfct5.Check17.Value = 0
        gfct5.Check18.Value = 0
        
        gfct6.Check1.Value = 0
        gfct6.Check2.Value = 0
        gfct6.Check3.Value = 0
        gfct6.Check4.Value = 0
        gfct6.Check5.Value = 0
        gfct6.Check6.Value = 0
        gfct6.Check7.Value = 0
        gfct6.Check8.Value = 0
        gfct6.Check9.Value = 0
        gfct6.Check10.Value = 0
        gfct6.Check11.Value = 0
        gfct6.Check12.Value = 0
        
        gfct7.Check1.Value = 0
        gfct7.Check2.Value = 0
        gfct7.Check3.Value = 0
        gfct7.Check4.Value = 0
        gfct7.Check5.Value = 0
        gfct7.Check6.Value = 0
        gfct7.Check7.Value = 0
        gfct7.Check8.Value = 0
        gfct7.Check9.Value = 0
        gfct7.Check10.Value = 0

end sub
以上附件是要将下面几页的键值清空
求教师傅有没有什么简单的方法,谢谢!
搜索更多相关主题的帖子: 清空 下一页 键值 Sub Value 
2017-05-02 16:03
wmf2014
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:216
帖 子:2039
专家分:11273
注 册:2014-12-6
收藏
得分:5 
有的哦,contols对象,一个小循环即可解决。

能编个毛线衣吗?
2017-05-03 08:31
zlm091674
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2017-4-23
收藏
得分:0 
师傅们!
     如果我要将它们更改成控件组(共五页五个控件组),不知应该如何编写代码。
     如果这样操作我还需要修改,前面的编码,控件组合文本组的对应关系,这样也要,麻烦师傅们帮助代码如何编写啦!

先谢谢师傅们了!
(注释:我编辑的是一个考试系统)
2017-05-03 08:37
zlm091674
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2017-4-23
收藏
得分:0 
wmf2014您好!
     contols对象如何循环,谢谢!
2017-05-03 08:38
xiangyue0510
Rank: 14Rank: 14Rank: 14Rank: 14
等 级:贵宾
威 望:86
帖 子:938
专家分:5244
注 册:2015-8-10
收藏
得分:5 
随手写的,可能有点小错误,你自己研究下。
程序代码:
 Dim fs As Control

 For Each fs In Gfct1
  If LCase(TypeName(fs)) = "Checkbox" Then
     fs.Value = 0
  End if 

 Next
2017-05-03 08:52
风吹过b
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:364
帖 子:4947
专家分:30084
注 册:2008-10-15
收藏
得分:5 
把5楼的代码封装成一个函数,传递 参数,参数类型是窗体 。
每次调用时,把 Gfct1、Gfct2、Gfct3  等 传送进去。

sub ClearCheckbox(Fr as Form)    '如果xy
Dim fs As Control
 For Each fs In Ff
  If LCase(TypeName(fs)) = "Checkbox" Then
     fs.Value = 0
  End if
 Next
end sub

调用时:
call ClearCheckbox(Gfct1)

授人于鱼,不如授人于渔
早已停用QQ了
2017-05-03 10:30
快速回复:清空下一页键值
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016515 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved