Results 1 to 6 of 6

Thread: Using the Enter key of the keypad to dismiss the keyboard on windows phone 7

  1. #1
    Join Date
    Sep 2010
    Posts
    60

    Using the Enter key of the keypad to dismiss the keyboard on windows phone 7

    Hi am making an interface on my windows phone 7 and i am not able to write a code for the event where i can trap and dismiss the after hitting the enter key. Here i am using the HTC mobile phone from the last few days and it is serving me the best. Before this i have made lot of other interfaces but this one is a bit challenging. Please let me know that is it possible to do such event. If yes then please help me in getting the code. Also tell me if there is any other way in which i can do the same.

  2. #2
    Join Date
    Nov 2009
    Posts
    739

    Re: Using the Enter key of the keypad to dismiss the keyboard on windows phone 7

    I guess I can help you in this case what you have to here is just use the key down event of the textbox to handle the situation. As soon as you will set a particular textbox as the key down event then it will dismiss the keypad of your mobile phone. What you have to do here is just use the following code:
    Code:
    private
    void txtBoxIP_KeyDown(object sender, KeyEventArgs e)
    {
    if (e.Key == Key.Enter)
    { 
    MessageBox.Show("enter is being pressed");
    }

  3. #3
    Join Date
    Nov 2009
    Posts
    499

    Re: Using the Enter key of the keypad to dismiss the keyboard on windows phone 7

    I was also having the similar query when I was stuck in between the application interface. I was also making an interface and want to dismiss the keyboard through an event. And I think you are facing the similar one so what you have to do here is that just create a command button on the left corner of your screen or we can say on the lefty of the interface. The button which you will create must be the 1x1 Button then you have to call the method Button.Focus(). Where you can set the focus to be hidden of the keyboard. As you will hit the enter on that button it will automatically dismiss the keyboard. I hope that this will solve your problem.

  4. #4
    Join Date
    Nov 2009
    Posts
    129

    Re: Using the Enter key of the keypad to dismiss the keyboard on windows phone 7

    You can solve this issue what you will need a simple code that will enable you to dismiss the keyboard. The thing here is that you have to change the click event of the button that you will use to perform the action. That code will help you to disable the keyboard until the button is again hit or it will dismiss the keyboard till the button is clicked twice. Here is the code that will help you to dismiss the keyboard:
    Code:
    <Button B1:Name="bhidden"  Width="1" Height="1"
     HorizontalAlignment="Right" VerticalAlignment="Bottom" 
    Setfocus=”bhidden.Focus()” />

  5. #5
    Join Date
    Nov 2009
    Posts
    83

    Re: Using the Enter key of the keypad to dismiss the keyboard on windows phone 7

    Here you can use the array control, because if you will ask me then it is the best option for it and also it will hide the button. You have to use the Keydown event because it is an value change event. This event will filter the keypress of the array control by using the KeyDown. When the "enter" is pressed in the number pad then it will dismiss the keyboard as per the action set by the click event. But there is the slight change in the event here the right terminals will allow you to change the key as it was clicked. And this is the way in which you can replace the Enter with a tab (ASCII 9). And to do this or to perform this action it requires a case structure. I hope that this will help you for sure.

  6. #6
    Join Date
    Sep 2010
    Posts
    60

    Re: Using the Enter key of the keypad to dismiss the keyboard on windows phone 7

    Thank you all of you for considering my problem and also for giving the solutions. The thing here is that initially i was not being able to use the ketdown event but as the steps and codes mentioned by you people helped me in doing the same. But the thing here is that i got lot of errors while executing the code because the elements defined in the code where not defined by me in the program and when i did that the code was error free.

Similar Threads

  1. Microsoft keyboard's left shift key and enter key dont work
    By snacdaws in forum Hardware Peripherals
    Replies: 12
    Last Post: 29-10-2012, 07:39 PM
  2. Replies: 7
    Last Post: 08-05-2012, 11:18 AM
  3. iphone:How to dismiss keyboard after sending SMS
    By Sattu JI in forum Portable Devices
    Replies: 5
    Last Post: 21-10-2011, 11:39 PM
  4. Unlock the keypad on my cell phone
    By microam_i in forum Portable Devices
    Replies: 4
    Last Post: 08-12-2010, 11:20 PM
  5. How can I make the numeric keypad active when detached from the keyboard
    By 2muchreality in forum Hardware Peripherals
    Replies: 3
    Last Post: 24-02-2009, 07:07 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,243,778.65791 seconds with 17 queries