Hello,
I'm using the following code to ensure the user is entering a numeric value:
Private Sub txtSeriesPercent1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSeriesPercent1.TextChanged
EcoUnitIsDirty = True
If IsNumeric(txtSeriesPercent1.Text) Then
checkPercentTotal()
Else
MessageBox.Show("Value " & txtSeriesPercent1.Text & " is not numeric!", "Input error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
txtSeriesPercent1.SelectAll()
End If
End Sub
I use the .selectAll line so that the textbox text is highlight for the user to correct it.
It doesn't work...
If I put a breakpoint in the sub, and step through it, it works, and the textbox text ends up highlighted, but if I don't have a breakpoint, the textbox doesn't end up highlighted...
Why is this??
TIA!
Amber
I'm using the following code to ensure the user is entering a numeric value:
Private Sub txtSeriesPercent1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSeriesPercent1.TextChanged
EcoUnitIsDirty = True
If IsNumeric(txtSeriesPercent1.Text) Then
checkPercentTotal()
Else
MessageBox.Show("Value " & txtSeriesPercent1.Text & " is not numeric!", "Input error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
txtSeriesPercent1.SelectAll()
End If
End Sub
I use the .selectAll line so that the textbox text is highlight for the user to correct it.
It doesn't work...
If I put a breakpoint in the sub, and step through it, it works, and the textbox text ends up highlighted, but if I don't have a breakpoint, the textbox doesn't end up highlighted...
Why is this??
TIA!
Amber