Ok its been a while since i've done coding. So i thought would give it a shot again not doing too bad but having an issue with checking multiple textboxes to make sure only integers are present even when the user copies and pastes into the box. would like it to shift focus to the textboxes that don't have integers but not a necessity. Also i'm trying to run the check before i "call" the rest of my subs or functions. This is a windows form project using VB. currenty i have this as my button click event.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Call current_year_values()
Call retention_months()
Call Individual_Retention_Months()
Call future_retention()
End Sub
i was able to get this however the user can still copy and paste what ever they want into the text boxes.
Private Sub textboxgrosssubmit_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles textboxgrosssubmit.KeyPress
If Asc(e.KeyChar) <> 8 Then
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
End If
End If
End Sub
I have been researching the "try.parse" and found that seems the way to go, however i'm confused on how to set it up.
Thank you so much.