I am creating a login form in windows phone app , I want to trigger login button event on pressing enter button from finishing the form.
Requirement: While clicking enter button from last text field in login page should trigger login button event..
Code sample I know how to move from one text field to another on clicking enter button as below
private void passkeydown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
nextfield .Focus();
}
}
But I don't know how to trigger button click event here.
Try This:
if (e.Key == Key.Enter)
{
LoginButton_Click(sender,e); //here LoginButton_Click is click eventhandler
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With