Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
private void password_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
{
    if (e.Key == Key.Enter)
    {
        this.Focus();
    }
}


this is the code which i have used but still its not working
Posted

1 solution

C#
private void password_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
{
    if (e.Key == Key.Enter)
    {
        //you can set focus of non textbox control like button, lable or other
    }
}
 
Share this answer
 
Comments
Sunasara Imdadhusen 4-Jun-14 7:31am    
I haven't posted same answer. i have removed this.focus() because this is creating problem, instead of that use other control .focus()

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