levyuk
Well-known member
I have this class
Public Class Class1
Public TenToTwelve As Integer = 12
Public TwelveToTwo As Integer = 14
Public TwoToFour As Integer = 18
Public FourToSix As Integer = 18
Public SixToEight As Integer = 12
End Class
I call it in another form in this way
Dim CodeClass As New Class1
Then I would like to write to that class and change the values but it wont work
Protected Sub ButtonUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonUpdate.Click
CodeClass.FourToSix = CInt(TextBoxFour.Text)
CodeClass.SixToEight = CInt(TextBoxSix.Text)
CodeClass.TenToTwelve = CInt(TextBoxTen.Text)
CodeClass.TwelveToTwo = CInt(TextBoxTwelve.Text)
CodeClass.TwoToFour = CInt(TextBoxTwo.Text)
End Sub
My question is, why not?
Public Class Class1
Public TenToTwelve As Integer = 12
Public TwelveToTwo As Integer = 14
Public TwoToFour As Integer = 18
Public FourToSix As Integer = 18
Public SixToEight As Integer = 12
End Class
I call it in another form in this way
Dim CodeClass As New Class1
Then I would like to write to that class and change the values but it wont work
Protected Sub ButtonUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonUpdate.Click
CodeClass.FourToSix = CInt(TextBoxFour.Text)
CodeClass.SixToEight = CInt(TextBoxSix.Text)
CodeClass.TenToTwelve = CInt(TextBoxTen.Text)
CodeClass.TwelveToTwo = CInt(TextBoxTwelve.Text)
CodeClass.TwoToFour = CInt(TextBoxTwo.Text)
End Sub
My question is, why not?