Click here to Skip to main content
16,020,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a project

When I have finished inputting in one text box it should allow me to input in next text box all within one form.
Posted
Updated 27-Jun-10 21:29pm
v3
Comments
Sandeep Mewara 28-Jun-10 2:39am    
Your question is not clear. Is it that you are saying if you write in 1 textbox then focus moves to other? Or are you try to use a tab or so to move to next textbox when done with previous one?
Sandeep Mewara 28-Jun-10 3:36am    
If it is as stated now, how do you know that input is *finished*? Any fixed criteria? masted textbox you are using?

I think you are referring to control Validation.

In the designer, set the CausesValidation to True, this will cause the control to raise validation events when focus is lost etc.

The code below is an example that will retain focus on a textbox until ANY valid date is entered.

VB
Private Sub TextBox1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
    'text box must contain ANY valid date
    Dim thisText As TextBox = CType(sender, TextBox)

    If Not IsDate(thisText.Text) Then
        MsgBox("You must enter a valid date in the " + thisText.Name)

        thisText.Focus()
    End If
End Sub
 
Share this answer
 
i have it use for password text box.so wht i should have to do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900