2016-12-16 95 views
-1

我仍然在編程初學者請理解me..I有兩種形式,即「form1的」和「窗口2」 ......我有這樣的代碼在我的「form1的」複選框在VB6.0多種形式

Private Sub chkRegisteredLocation_Click() 

If checkbox1.value = 1 Then 
    datacombo1.Enabled = True 
Else 
    checkbox1.Enabled = False 
    datacombo1.Text = "" 

End If 
End Sub 

現在在我的「form2」中,我怎麼知道我的checkbox1是True還是Checked?

+0

是例如打開窗口2 form1中的按鈕? 哪種關係是形式?你可以附上一張照片嗎? – Twiebie

回答

2

已經解決了......

public blnCheckbox as Boolean 

Private Sub chkRegisteredLocation_Click() 

If checkbox1.value = 1 Then 
blnCheckbox = True 
datacombo1.Enabled = True 
Else 
checkbox1.Enabled = False 
datacombo1.Text = "" 

End If 
End Sub 

窗體2

If form1.blnCheckbox = True Then 
msgbox("Checked") 
end If