J
Just_a_fan
I am adding a bunch of controls with the code below.
Problem 1: When program flow passes to "UpperChanged" when I click it,
the control name is undefined. When I enter:
If udUpperLim1.Value > 1 Then
I get an error that udUpperLim1 is "Not Defined" so I cannot get the
value in the control.
Problem 2: When I use sender.tostring, it returns the class name of the
control, not its assigned name. I get
"System.Windows.Forms.NumericUpDown" and not udUpperLim1 and I don't
know who was changed and along with the preceding problem, even if I
did, I can't reference it!
The folks who decided to remove control arrays DID NOT DO US ANY
FAVORS!!!!!!!!!!
This is all straight out of a book and is not doing anything useful for
me.
Help, Please!
Mike Morrow
MSDN:MMSA00E62537
iTop = 84
Dim udUpperLim1 As New NumericUpDown
udUpperLim1.SetBounds(228, iTop, 45, 20)
iTop += 20
Me.Controls.Add(udUpperLim1)
AddHandler udUpperLim1.ValueChanged, AddressOf UpperChanged
udUpperLim1.Value = My.Settings.Alarm1
Dim udUpperLim3 As New NumericUpDown
udUpperLim3.SetBounds(228, iTop, 45, 20)
iTop += 20
Me.Controls.Add(udUpperLim3)
AddHandler udUpperLim3.ValueChanged, AddressOf UpperChanged
udUpperLim3.Value = My.Settings.Alarm3
Dim udUpperLim5 As New NumericUpDown
udUpperLim5.SetBounds(228, iTop, 45, 20)
iTop += 20
Me.Controls.Add(udUpperLim5)
AddHandler udUpperLim5.ValueChanged, AddressOf UpperChanged
udUpperLim5.Value = My.Settings.Alarm5
Problem 1: When program flow passes to "UpperChanged" when I click it,
the control name is undefined. When I enter:
If udUpperLim1.Value > 1 Then
I get an error that udUpperLim1 is "Not Defined" so I cannot get the
value in the control.
Problem 2: When I use sender.tostring, it returns the class name of the
control, not its assigned name. I get
"System.Windows.Forms.NumericUpDown" and not udUpperLim1 and I don't
know who was changed and along with the preceding problem, even if I
did, I can't reference it!
The folks who decided to remove control arrays DID NOT DO US ANY
FAVORS!!!!!!!!!!
This is all straight out of a book and is not doing anything useful for
me.
Help, Please!
Mike Morrow
MSDN:MMSA00E62537
iTop = 84
Dim udUpperLim1 As New NumericUpDown
udUpperLim1.SetBounds(228, iTop, 45, 20)
iTop += 20
Me.Controls.Add(udUpperLim1)
AddHandler udUpperLim1.ValueChanged, AddressOf UpperChanged
udUpperLim1.Value = My.Settings.Alarm1
Dim udUpperLim3 As New NumericUpDown
udUpperLim3.SetBounds(228, iTop, 45, 20)
iTop += 20
Me.Controls.Add(udUpperLim3)
AddHandler udUpperLim3.ValueChanged, AddressOf UpperChanged
udUpperLim3.Value = My.Settings.Alarm3
Dim udUpperLim5 As New NumericUpDown
udUpperLim5.SetBounds(228, iTop, 45, 20)
iTop += 20
Me.Controls.Add(udUpperLim5)
AddHandler udUpperLim5.ValueChanged, AddressOf UpperChanged
udUpperLim5.Value = My.Settings.Alarm5