Dim myinteger As Integer = Convert.ToInt32(MyTextBox.Text)
Dim originalvalue As Integer = myinteger
' i assume you do something here
If myinteger = somevalue AndAlso Integer.Equals(myinteger, originalvalue) Then
' do something here
End If
Actually i don't understand your question completely so can you rephrase it please?
I think you create a tempuary Integer variable, you may declare it as a static variable and global. Then asign the integer initial value to it before using it. so u can determine if there is changes by comparing the tempuary integer variable and the main integer.
Dim tempinteger As Integer 'type at the class level to make it global
'new procedure
Dim maininteger As Integer
'maininteger may get its initial value
'whether after a procedure
tempinteger = maininteger 'tempuarilly storing the initial value
'code the sub that may change the integer value
If tempinteger <> maininteger Then 'if statement to determine if their is a changes
'there is changes
Else
'no changes
End If
if am not missinterpreting your question, but this i my opinion
Personally, I would create a private variable (type: integer) and in the setter check the incomming value against the variable, if they're different I would then set the variable to the value & raise an event.
Then in the code instead of using the variable I would use the new property. That way, whenever the property is set, if different you can fire an event to run some code that does something with it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.