Reputation: 127
In my app,I just have a page with four text boxes, so when i click a text box soft keyboard appears, now when i want to move to next textbox then i have to tap outside the textbox to make the keyboard disappear and then click on another text box. I don't think it is user friendly, so i have two options, 1)To change the functionality of return button(to make it work as tab). 2)To reduce the frame size and so scrolling will be enabled.
How can I do the foretold two options in windows phone 7??
Upvotes: 0
Views: 152
Reputation: 806
For moving to next textbox @Amu 's answer will work perfect, and to dismiss the keyboard,
if (e.Key == System.Windows.Input.Key.Enter)
{
this.Focus();
}
That will take the focus away from your text box and will bring it to your screen. And So keyboard will disappear!
Upvotes: 1
Reputation: 3331
for the first option Make return key of the input panel work like tab key.
make key down event of 1st textbox like this
private void txt1_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == System.Windows.Input.Key.Enter)
{
txt2.Focus();
}
}
similarly make this event for txt2 and txt3 and give focus accordingly and on on txt4 keydown event focus the main grid.
and about the 2nd way. Its a big problem in wp according to my knowledge.
Upvotes: 3