Click here to Skip to main content
Rate this: bad
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 at 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
0 Zoltán Zörgő 185
1 Sergey Alexandrovich Kryukov 160
2 Peter Leow 100
3 CPallini 70
4 Ramza360 51
0 Zoltán Zörgő 80
1 the other paul 23
2 Shmuel Zang 10
3 Aarti Meswania 5
4 Member 11389991 -2

Advertise | Privacy | Mobile
Web02 | 2.8.150129.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2015
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