vb前端显示代码
求CheckBox在最前端显示的还可以取消前端显示的代码
[此贴子已经被作者于2018-7-6 20:58编辑过]
[此贴子已经被作者于2018-7-6 20:58编辑过]
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
Private Sub Form_Load() Check1.Caption = "前端显示" Check1.FontName = "宋体" Check1.FontSize = "12" Check1.ForeColor = &H0 Check1.Value = 1 End Sub