How to set a limit for Numeric Updown menu?

  • Thread starter Thread starter lelouch_vi
  • Start date Start date
L

lelouch_vi

Guest
Hi,

I need some little help here. i can't figure out a way here.

I have a NUD and it is connected to a label. What I wanted to do is when the NUD reaches 0 it should display a message like "You don't have enough points". I got this part working but the message is popping twice. I know it's just a minor bug but I'm already trying to figure this out for hours.

Below is the code I'm using to validate if the NUD is already at 0.

Private Sub numCategory_ValueChanged(sender As Object, e As EventArgs) Handles numCategory.ValueChanged


If num <> 0 Then

lblpoints.Text = (num - numCategory.Value).ToString

Else


MsgBox("No more points to allocate")
numCategory.Value = 0

End If

End Sub


1592970.gif

As you can there, I clicked the OK in the message box but it still it pop ups again.

Continue reading...
 
Back
Top