×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    3

    How to capture "@" key pressed on textbox?

    I wrote below code for capturing "@" pressed or not. And working perfectly fine on Emulator and on Samsung Focus. But when deployed to Nokia Lumia 800 and pressed "@" it wont resulted in Key.D2 and below code not working.

    if (e.Key == System.Windows.Input.Key.D2)
    {
    myBox.Text = "@";
    }

    Please guide me how can i capture "@" and "#" key pressed on my textbox. Thanks in Advance

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2012
    Location
    Bilbao
    Posts
    53

    Re: How to capture "@" key pressed on textbox?

    The @ is an special key, its better to use the PlatformKeyCode property on KeyEventArgs to handle it. I test on my lumia this code and working fine:

    Code:
    private void TextBox_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.PlatformKeyCode == 233)
            MessageBox.Show("@ pressed");
    }
    Hope this help.

  3. #3
    Registered User
    Join Date
    Feb 2012
    Posts
    3

    Re: How to capture "@" key pressed on textbox?

    Thanks for your reply. I will check on my lumia and focus + emulator and report back.

Similar Threads

  1. How to detect "Options" key pressed event ?
    By Md. Kayesh in forum Symbian User Interface
    Replies: 15
    Last Post: 2012-01-19, 11:28
  2. realise a pressed "switch component"
    By whiteF in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2011-12-19, 09:25
  3. Replies: 1
    Last Post: 2009-12-08, 04:04
  4. Replies: 2
    Last Post: 2007-03-06, 05:20

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×