Click here to Skip to main content
15,915,611 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

What is the events for textbox which I want to use to check when user press Tab key or click other textbox? I already have the code, but I don't know the events. It just check the confirmation password when user want to create new account..Could someone tell me?
Posted

you can use the onblur event in a textbox which basically means that the focus is moved from the control
 
Share this answer
 
hi,
try following code for lost focus event

VB
Private Sub TextBox1_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
    Dim est As Decimal
    If TextBox1.Text.Length = 0 then Exit Sub   '' optional
    If Not Decimal.TryParse(TextBox1.Text.Trim, est) Then
        e.Cancel = True
        TextBox1.SelectAll()
    Else
        TextBox1.Text = est.ToString("N0")
    End If
End Sub


hope it will Help u
Best Luck
Happy Coding
 
Share this answer
 
Comments
Luiey Ichigo 12-Apr-12 2:07am    
I'm sorry Nilesh..the code not even run..

This is the code that I will actually want to put

If txtAdminPwd.Text <> String.Empty Then
If txtAdminPwd.Text = txtConfirmPwd.Text Then
pbxGreen.Visible = True
Else
pbxRed.Visible = True
End If
End If

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