Forget about #19, I must have posted at the same time as #18!
The ValueChanged event handler was created when I double clicked on the control.
So, if I'm correct the form is a Module, therefore any variables I declare in that module will be available to any of the sub-routines.
How does it change if in a ValueChanged event?
Could you give me an example?
Assuming that the way I have written these subs is correct, then:
I have 2 NUD controls and have changed one like so:
The other NUD is similar, but says that nudTop has not been declared??Code:Private Sub nudFSize_ValueChanged(sender As Object, e As EventArgs) Handles nudFSize.ValueChanged Dim Fsize As Integer = CInt(nudFSize.Value) MessageBox.Show(CStr(FSize)) End Sub
Why does the nudTop have the Handles part?Code:Private Sub nudTop_ValueChanged(sender As Object, e As EventArgs) Dim CTop As Integer = CInt(nudTop.value) End Sub
Why does the FSize one not show the same error?
I did try as InteliSense suggested, but that still said that nudTop had been used before it had been assigned a value?
Code:Dim nudTop As NumericUpDown = nudTop




Reply With Quote
