Click here to Skip to main content
11,411,840 members (52,165 online)
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 OriginalGriff 243
1 Sergey Alexandrovich Kryukov 200
2 Sascha Lefévre 130
3 ProgramFOX 130
4 Maciej Los 90
0 Sergey Alexandrovich Kryukov 8,955
1 OriginalGriff 7,158
2 Maciej Los 3,480
3 Abhinav S 3,248
4 Peter Leow 3,059

Advertise | Privacy | Mobile
Web03 | 2.8.150414.5 | 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