Option Explicit
Dim A As Integer '加上这一句
Private Sub Form_Load()
a = 1 '这儿a默认只能在form_load过程生效
End Sub
Private Sub Command1_Click()
Label1.Caption = a '这儿的a也默认只在command1_click过程里面查找,找不到这个变量,只能返回空值了
End Sub
Private Sub Command1_Click()
Dim a As Integer
a = 1
Label1.Caption = a
End Sub
Dim a As Integer
a = 1
Label1.Caption = a