manually exit from typing mode of textbox in WP7 - c#

I have a scenario in my windows phone 7 app. I have panarama control and it has 4 items in it. Let say in first Item I have textbox and my focus on it Mean My cursor in it and I was typing on this textbox. But when typing mean when my focus is still in textbox and I changes the panorama item. My textbox focus is still there and still its in typing mode. How I can exit my textbox from typing mode on panaroma selection change.

Windows Phone has no way to hide the keyboard other than to focus on a different element.
For example, if you have a hidden button, call button.focus(); to hide the soft-keyboard.

Related

WPF Keep textbox focussed while pressing tab key

I am writing a WPF application where we are supposed to shift focus from one button to another by pressing the TAB key.
All is fine, but for a specific page, there is a textbox which is always focused so that the user can type in it immediately. But now, when I press TAB, the focus is shifted to the button (which is as per requirement) but as the focus is lost from the textbox, I cannot type anymore.
I want to have a behavior where I can keep the Keyboard focus on textbox but should be able to control the buttons using TAB key as well. In a way, I need to have focus on textbox and the buttons at the same time. Is this possible?
Tried the FocusManager.IsFocusScope = "true", but this did not help.

Need to tap twice on touchscreen to click button in WPF

I have a WPF application that at one point brings up another window where the user can enter text in a field that is selected on open then click OK to save the text. This is working correctly on my desktop using a mouse, but when I run the application on a tablet (Surface Pro) the OK button needs to be tapped twice to save the text. The first tap highlights the button, then the second tap clicks it. Is there any way to allow the user to click the button with just one tap on the screen?
This only happens when the application switches to the new window. The main window only requires one tap to click buttons (Though I have noticed that they require two when switching back to the main window). It seems like this issue has to do with focus or something because if I tap somewhere on the new window before clicking OK, I can tap OK once and it will trigger the click event.
You probably need something like this in your code:
textBox1.Focus();
The other place to consider is the Tab order of the items on the form. Once the focus leaves the textbox, it moves to the next highest tab order object. It should be the OK button.
You can adjust the Tab order by looking at the properties of the objects on the form.
This is a bug in WPF combined with a touch display.
Because the textbox is focused, and you press the button, the textbox gets unfocused and the button gets focus. When the button has focus, you just have to press it in order to save your text.
There really isn't a thing you can do about it, since the touchscreen focuses first on the button before you can fire the event (I think it probaly is a kind of a safety feature).

TextBox for windows universal - event for delete button?

I use standart TextBox in my windows universal app. When I enter text to TextBox
appears button delete.
I need a press event to button delete. It should simply be, but I found nothing. Or do I just go to sleep :)
update:
I solved this problem by binding properties of the text.

How to show an alert in Windows Universal Apps with Radio buttons which does not light dismiss?

I am working on Universal apps and I am new in this platform. I want to display an Alert box with languages in it and get input from User based on RadioButton checked. I used CustomMessageBox in Windows Phone 8 for this purpose. But its not available in Windows Universal apps. So, I tried MessageDialog but in that we can't add other controls. After some research I found a Control named Flyout, using which I was able to display Radio button and got user input. But if user taps outside that flyout then the flyout closes. So the language is not selected. Please can anyone suggest a control which can be used.
You can use a User Control. You can style it as you need and make it look like an alert box and place all your radio-buttons and stuffs inside.
User controls does not contain the IsLightDismiss property (Light dismiss is when the user taps on any area other than the popup.) as pop-ups have, so the user control will not get dismissed until a condition is met.
User controls has Visibility property, by using this you can show/hide it according to your conditions and logic.

wpf textbox focus issue

I have a control with several textbox controls on it.
Now, when I press tab after I edit one of the textboxes, the focus is switched to the next textbox BUT I need to press an additional tab in order for it to enter the "editing" stage.
The first tab simply draws a dotted background on the textbox ... and the second one actually puts the cursor position inside the textbox. Is there a way when I press tab, to automatically set the cursor inside the textbox?
Thanks./
Are you sure you don't have any hidden controls or other controls that might be accepting focus before your textbox? Either way, you should be able to update the tabindex value of your controls so they follow a logical sequence when tab is pressed.

Categories