NumericUpDown and GetNextControl - "Value" not supported in .NET framework?

angrycoder

New member
Joined
Jun 11, 2004
Messages
2
Programming Experience
3-5
NumericUpDown and GetNextControl - "Value" not supported in .NET framework?

Why can't I change the Value field in a NumericUpDown control with something like this using GetNextControl()?

VB.NET:
[size=2][color=#0000ff]Dim[/color][/size][size=2] thing [/size][size=2][color=#0000ff]As [/color][/size][size=2][color=#0000ff]Object[/color][/size][size=2] = price1.GetNextControl([/size][size=2][color=#0000ff]Me[/color][/size][size=2], [/size][size=2][color=#0000ff]False[/color][/size][size=2])
 
thing.Value = 5[/size]

where the previous tab control to "price1" is a NumericUpDown control.
I've tried casting it explicitly:

VB.NET:
[size=2][color=#0000ff]Dim[/color][/size][size=2] thing [/size][size=2][color=#0000ff]As[/color][/size][size=2] System.Windows.Forms.NumericUpDown
 
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] thing2 [/size][size=2][color=#0000ff]As [/color][/size][size=2][color=#0000ff]Object[/color][/size][size=2] = price1.GetNextControl([/size][size=2][color=#0000ff]Me[/color][/size][size=2], [/size][size=2][color=#0000ff]False[/color][/size][size=2])
 
thing = [/size][size=2][color=#0000ff]DirectCast[/color][/size][size=2](thing2, System.Windows.Forms.NumericUpDown)
 
thing.Value = 5
 
[/size]

I WANT do this...

VB.NET:
 [size=2]
[/size][size=2]price1.GetNextControl([/size][size=2][color=#0000ff]Me[/color][/size][size=2], [/size][size=2][color=#0000ff]False[/color][/size][size=2]).Value = 5[/size][size=2]
 
[/size]

...but there seems to be no "Value" field in System.Windows.Form.Control objects, even though NumericUpDown is a valid control.

so...can anyone explain how to change a NumericUpDown value when accessing it through GetNextControl()?
 

tlkerns

Member
Joined
Jun 3, 2004
Messages
19
Programming Experience
3-5
I was looking at the VS.net help and I think this is how it should work:

Dim thing as Control = Me.GetNextControl(price1, False)
DirectCast(thing, NumericUpDown).Value = 5

Tony
 
Top Bottom