here you go.. you owe me a cookie![]()
you will notice this routine does the followingVB Code:
Private Sub CheckForPeriod(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtIP1.KeyPress, txtIP2.KeyPress, txtIP3.KeyPress, txtIP4.KeyPress 'CHECK FOR A "." If e.KeyChar = "."c Then 'SET HANDLED TO TRUE SO THE "." IS NOT PROCESSED e.Handled = True 'SEND THE TAB KEY TO GO TO THE NEXT CONTROL Me.ProcessTabKey(True) End If End Sub
1) checks for a . being entered in any of the 4 IP boxes (notice this routine HANDLES 4 different keypress events - one from each IP box)
2) sets handled to true so a . doesn't come up in the textbox
3) sends a tab keypress to the form which will send focus to the next item in the taborder




Reply With Quote