I'm using Visual Studio 2013. My issue is that I can't get any value of my form1 from any class.
This is my code
Public MyHour as DateTime
Public SomeValue as string
Public MyClass as SomeClass
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
MyHour = datetime.now()
Somevalue = "asjdasd"
MyClass = new Someclass()
End Sub
Here is the button1 click event code in form1:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Myclass.mysub()
End sub
When I call a sub on my class I can't access to anything of my form1:
public sub mysub()
Dim datetovalidate as datetime= form1.actualhour
Dim stringtovalidate as string = form1.somevalue
messagebox.show(datetovalidate.tostring)
messagebox.show(stringtovalidate)
end sub
From my class:
Datetovalidate
shows me: 01/01/0001 00:00:00Stringtovalidate
shows me : ""
Even If I try to access to a property of a control in my form1 from my class nothing happens, and there is no exception being fired and no errors show me up for this situation. What can I do?