Click here to Skip to main content
12,823,725 members (59,108 online)
Rate this:
Please Sign up or sign in to vote.
See more: WinRT
Hi my friends,

well, I need your help with finding the right event for the textbox here... I like to let the user write some information in it, when he presses enter it should be added to a label. well thats easy, but which is the right event for touch input? could anyone please help me here?

Thanks a million times!

Posted 16-Jan-13 8:48am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


Is "Enter" a button or the keyboard key "enter"?

If it is a button, I would use the button's tapped event, the click event occurs before and you could use it too.
If it is the keyboard key then a good place to put your code is the keyup event of the TextBox

private void textBox1_KeyUp(object sender, KeyRoutedEventArgs e)
    if (e.Key == Windows.System.VirtualKey.Enter)
        textBlock1.Text = textBox1.Text;

All these events are fired if you use a touch interface or a mouse, so there should be no problems.

Alex Großmann 17-Jan-13 6:17am
Thank you so much!

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100