小弟是因使用下列的設定
共宣告 [3個] 新的物件模組
Set Test2(i) = New clsTest2
也是因為這【3個】各自獨立的新物件
模組互不相通,boolean才無法回傳正確。
不知小弟的判斷是否是對的嗎?
下列是小弟修正之後:
Case Is = 1
Set Test2 = New clsTest2
With Test2
Set .cmd3 = Me.Controls("CommandButton3")
Set .cmd4 = Me.Controls("CommandButton4")
Set .cmd5 = Me.Controls("CommandButton5")
Set .mTxtb2 = Me.Controls("TextBox2")
.mdTrue = True
End With
End Select
Private Sub mCmd3_Click()
If mTrue = False Then
mTrue = True
Else
mTrue = False
End If
mTxt2 = mTrue
End Sub
Private Sub mCmd5_Click()
If mTrue = True Then
mTrue = False
Else
mTrue = True
End If
mTxt2 = mTrue
End Sub