Im creating this program and ive run into a very odd error...
Consider this...
this is what i got on my program
2 x NumericUpdown
1 x Textbox
this is the code for numericupdown1
This code works fine and without any problems..
now for the next Numericupdown (2)
i want to make it add +5 to Textbox value each time i press UP and take -5 each time i press DOWN.
This is the code i got in Numericupdown2
INT and HCK is created in the start of my program like this
and in FORMLOAD i added this
But each time i try to launch my program it gives me an error in this line ..
something about it cannot convert from ""
but the funny thing is, that there is no probs in the other numericupdown control.. and they got the exact same kind of property's
Please help me anyone =)
Consider this...
this is what i got on my program
2 x NumericUpdown
1 x Textbox
this is the code for numericupdown1
VB.NET:
Private Sub NUHCK_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NUHCK.ValueChanged
Dim newhck As Integer
newhck = NUHCK.Value
Dim show As Short
show = POINTSINT.Text
'check if user clicked the up button then do this.
If newhck > HCK Then
'substrating from totalpoints
If newhck >= 0 And newhck < 50 Then
show = show - 1
POINTSINT.Text = show
ElseIf newhck >= 50 And newhck < 75 Then
show = show - 2
POINTSINT.Text = show
ElseIf newhck >= 75 And newhck < 100 Then
show = show - 3
POINTSINT.Text = show
ElseIf newhck >= 100 Then
show = show - 5
POINTSINT.Text = show
'Når man trykker value ned
End If
ElseIf newhck < HCK Then
If newhck >= 0 And newhck < 50 Then
show = show + 1
POINTSINT.Text = show
ElseIf newhck >= 50 And newhck < 75 Then
show = show + 2
POINTSINT.Text = show
ElseIf newhck >= 75 And newhck < 100 Then
show = show + 3
POINTSINT.Text = show
ElseIf newhck >= 100 Then
show = show + 5
POINTSINT.Text = show
End If
End If
HCK = newhck
End Sub
This code works fine and without any problems..
now for the next Numericupdown (2)
i want to make it add +5 to Textbox value each time i press UP and take -5 each time i press DOWN.
This is the code i got in Numericupdown2
VB.NET:
[size=2]
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] newint [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]Integer[/color][/size]
[size=2]newint = NUINT.Value[/size]
[size=2][color=#0000ff]Dim[/color][/size][size=2] show [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]Short
[/color][/size][size=2]show = POINTSINT.Text
[/size][size=2][color=#0000ff]if[/color][/size][size=2] newint > INT [/size][size=2][color=#0000ff]Then[/color][/size]
[size=2]show = show + 5
POINTSINT.Text = show
[/size][size=2][color=#0000ff]ElseIf[/color][/size][size=2] newint < INT [/size][size=2][color=#0000ff]Then[/color][/size][size=2][color=#0000ff]
[/color][/size][size=2]show = show - 5
POINTSINT.Text = show
[/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If
[/color][/size]
INT and HCK is created in the start of my program like this
VB.NET:
[size=2]
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] INT [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]Integer[/color][/size]
[color=#0000ff]D[size=2]im[/size][/color][size=2] HCK [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]Integer
[/color][/size]
and in FORMLOAD i added this
VB.NET:
[size=2]
INT = NUINT.Value
HCK = NUHCK.Value
[/size]
But each time i try to launch my program it gives me an error in this line ..
VB.NET:
show = POINTSINT.Text
but the funny thing is, that there is no probs in the other numericupdown control.. and they got the exact same kind of property's
Please help me anyone =)