Click here to Skip to main content
12,304,203 members (75,305 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!

Alex
Posted 16-Jan-13 7:48am

1 solution

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

Solution 1

Hello,

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.

Valery.
  Permalink  
Comments
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.160530.1 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2016
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