Following code i use :
Public Class Form1
Dim myisTime As Boolean
Public Property isTime() As Boolean
Get
Return myisTime
End Get
Set(ByVal value As Boolean)
myisTime = value
End Set
End Property
Public Shared Sub TestProp()
If isTime Then
msgbox("Yes..timings are on....")
else
msgbox("No....timings are off...")
end if
End Sub
Private Sub CheckBoxisTime_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxLocalTime.CheckedChanged
isTime = CheckBoxisTime.Checked
End Sub
End Class
isTime gives error of instantiation...can't use it without instance of class.....
How to deal with ? where i am wrong please help.
2006-10-21
21:25:13
·
2 answers
·
asked by
VBNewComer
1
in
Computers & Internet
➔ Programming & Design
That means, move whole declaration portion of isTime code to another module, then initialise it, save that variable in that module and use it from that module is it ?
2006-10-21
21:57:40 ·
update #1
That way is ok, but is there any otherway like if i make whole project one NameSpace and then do it ? I use only one form application and want to check that isTime checkbox is checked, do one thing otherwise, other. And while my one form application is running, variable declared in same class should be accessable, isn't it ?
Thanks for helping me out....
2006-10-22
01:18:32 ·
update #2