Changing the value of an Interger in another class

levyuk

Well-known member
Joined
Jun 7, 2004
Messages
313
Location
Wales, UK
Programming Experience
3-5
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?
 
well asp code can be in vb, c#, c++ so you had the right idea, but since this is a vb forum the asp section here would naturally be all vb as well

at least it's been resolved :)
 
Back
Top