标题:vb前端显示代码
只看楼主
chizhawulei
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2018-6-28
结帖率:100%
已结贴  问题点数:20 回复次数:3 
vb前端显示代码
求CheckBox在最前端显示的还可以取消前端显示的代码


[此贴子已经被作者于2018-7-6 20:58编辑过]

搜索更多相关主题的帖子: vb 显示 代码 CheckBox 取消 
2018-06-30 22:43
wufuzhang
Rank: 9Rank: 9Rank: 9
来 自:广州
等 级:贵宾
威 望:21
帖 子:206
专家分:1346
注 册:2017-8-9
得分:7 

程序代码:
Option Explicit

Dim CheckedFlag As Boolean

Private Sub Check1_Click()
  If Check1.Value = 1 Then
     CheckedFlag = True
  Else
     CheckedFlag = False
  End If
  Call FrontShow
End Sub

Private Sub Form_Load()
  Form1.Caption = "前端显示"
  Form1.AutoRedraw = True
  Debug.Print "Form_Load"
End Sub

Private Sub FrontShow()
  If CheckedFlag Then
     Form1.Cls
     Print "Option Explicit" & Chr(13) & Chr(13) & _
           "Dim CheckedFlag As Boolean" & Chr(13) & Chr(13) & _
           "Private Sub Check1_Click()" & Chr(13) & _
           "  If Check1.Value = 1 Then" & Chr(13) & _
           "     CheckedFlag = True" & Chr(13) & _
           "  Else" & Chr(13) & _
           "     CheckedFlag = False" & Chr(13) & _
           "  End If" & Chr(13) & _
           "  Call FrontShow" & Chr(13) & _
           "End Sub" & Chr(13) & _
           Chr(13) & Chr(13) & _
           "Private Sub Form_Load()" & Chr(13) & _
           "  Form1.Caption =" & Chr(34) & "前端显示" & Chr(34) & Chr(13) & "" & _
           "  Form1.AutoRedraw = True" & Chr(13) & _
           "  Debug.Print" & Chr(34) & "Form_Load" & Chr(34) & Chr(13) & _
           "End Sub" & Chr(13) & _
           Chr(13) & Chr(13) & _
           "Private Sub FrontShow()" & Chr(13) & _
           "  If CheckedFlag Then" & Chr(13) & _
           "     Print" & Chr(13) & _
           "  Else" & Chr(13) & _
           "     Form1.Cls" & Chr(13) & _
           "  End If" & Chr(13) & _
           "End Sub"
  Else
     Form1.Cls
  End If
End Sub

不经历千百遍的调试,怎能体会成功时那一刹那的喜悦。
2018-07-01 16:43
ZHRXJR
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:125
帖 子:1034
专家分:5519
注 册:2016-5-10
得分:7 
这样小儿科的问题难道还要别人教你吗?
在窗体放置一个 CheckBox 控件,下面是代码:
程序代码:
Private Sub Form_Load()
Check1.Caption = "前端显示"
Check1.FontName = "宋体"
Check1.FontSize = "12"
Check1.ForeColor = &H0
Check1.Value = 1
End Sub

请不要选我!!!
2018-07-02 11:37
Artless
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:103
帖 子:4211
专家分:28888
注 册:2009-4-8
得分:7 
置顶?

无知
2018-07-05 00:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-488300-1-1.html




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

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