Hello.
I want to perform the same lines of code whenever a control is modified in a form.
V.gr.:
Am I supposed to write the subroutine as a class, as a function, bellow a label?
Sth similar to this?
Thank you for your patience.
I want to perform the same lines of code whenever a control is modified in a form.
V.gr.:
VB.NET:
Public Class Form1
Dim Inival As Double = NumUpDownInitial.Value
Dim Finval As Double = NumUpDownFinal.Value
Dim Result As Double
Private Sub NumUpDownInitial_ValueChanged(sender As Object, e As EventArgs) Handles NumUpDownInitial.ValueChanged
sthchanged
End Sub
Private Sub NumUpDownFinal_ValueChanged(sender As Object, e As EventArgs) Handles NumUpDownFinal.ValueChanged
sthchanged
End Sub
...
sthchanged:
Inival = NumUpDownInitial.Value
Finval = NumUpDownFinal.Value
Result = Finval - Inival
...
Am I supposed to write the subroutine as a class, as a function, bellow a label?
Sth similar to this?
VB.NET:
Public Function sthchanged()
Inival = NumUpDownInitial.Value
Finval = NumUpDownFinal.Value
Result = Finval - InivalEnd Function
End Function
Last edited: