How do you check if an input is a negative number in VB
问题 I am trying to do some validation which checks if the value in a textbox is an integer then checks if the the value is negative. It correctly checks if the value is an integer but I can't get it to check if the value is negative. Note: The value being entered is the number of competitions attended so comps = competition etc... Dim comps As Integer Dim value As Double If Integer.TryParse(txtCompsEntered.Text, integer) Then value = txtCompsEntered.Text If value < 0 Then lblcompsatten.ForeColor