How do I programmatically close the onscreen keyboard for my WP7 app?
The only way would be to change the focus to be away from the TextBox that's causing it to be open, with .Focus on some other control. You can put it on a non visual control if you prefer.
If you're on a page that has no other sensible control to switch focus to, setting IsEnabled = false (and then back to true straight away if you want) on the TextBox which has focus will also close the SIP.
http://www.geekchamp.com/tips/how-to-hide-the-soft-keyboard-in-a-windows-phone-app
You will love this, It solved my problem when search clicked
Related
Is there a way to deactivate phone7 keyboard in my project when Textbox gets focus ?
you can hide the keyboard by moving the focus away from the keyboard by calling
this.hide();
however this does give a flicker.. alternative is to set your textbox to be readonly. I haven't tried this approach yet
In my Windows Phone 7 Silverlight application I have my own custom keypad that I want to use instead of the standard soft keyboard. The problem that I have is that I have not found a way to completely disable or prevent the SIP/Soft Keyboard for my application or for the TextBox component.
Is it possible to disable the soft input keyboard in my application?
Is it possible to prevent the soft input keyboard from popping up when a TextBox get focus?
Can I extend or override any functions in TextBox to make it behave the way I want?
I’ve seen solutions how to hide the keyboard when a certain key is entered by moving focus off the TextBox but I want to prevent it from ever showing up.
My problem is very similar to what's stated on How do I prevent the software keyboard from popping up? and How to prevent keyboard to show in EditText onTouch? but for Windows Phone 7 instead.
I am fully aware that some may think it is stupid to use your own keypad instead of the standard input but I have my reasons for doing it this way and I just want to know if it is possible to achieve what's described.
If you don't want to use the SIP, you don't need a TextBox.
Use a TextBlock and bind it to the input generated by the custom buttons.
Have a look at this blog post http://www.silverlightshow.net/items/Windows-Phone-7-Creating-Custom-Keyboard.aspx
Peter, consider using THIS, with customizations. I'm working in a project where we use a custom keyboard. With some extra codes and customizations I've made a custom softkeyboard, as you can see in the screenshot bellow. Right now, my softkeyboard is working properly, but with some issues to be resolved yet.
My custom WP keyboard problems are:
There's no caret cursor;
The TextBox in my screen is a AutoCompleteBox, and when it opens the completions, my keyboard loses focus, and so I need an extra tap (this is my greates problem now)
WP native keyboard try to slide up when I choose an item within the completions
IsHitTestVisble =false solve your issue
Simple question:
How do I detect that the onscreen keyboard has been displayed on windows mobile 7? Is there an event I can add a listener to?
It takes up about half the screen and I want to scroll the view up when it gets displayed...
EDIT:
A comment below indicates more clearly what I'm trying to do: I have a textbox input, and as the user types into it an autocomplete dropdown appears below it (like google suggest). By default, the active control (the textbox) scrolls into view when focussed, and the onscreen keyboard is directly below it. The onscreen keyboard appears in front of my autocomplete dropdown - what I want to do is make the screen scroll a little further up, so there's some room for my dropdown to be shown.
The windows phone UI design guidelines say: "When the keyboard is deployed, the application should scroll to ensure the active edit control and the caret are in view". This happens fine, it's just the non-active dropdown gets hidden behind the onscreen keyboard.
The guidelines also say that an application can choose to show the onscreen keyboard, and can also choose to close it.
At the moment i'm stuck, and I don't think (based on my research and the replies to this question) that it's possible to detect that the onscreen keyboard has been displayed. I'm moving my investigation to see if it's possible to determine the "visible area" of the page (width & height in pixels for example), and combine this with an onfocus for the textbox... not sure if this will prove fruitful though.
Detecting when the virtual keyboard is displayed won't be possible in 7.0, as confirmed by Microsoft's Peter Torr in the WP7 forum on MSDN.
Maybe, as a dirty workaround, you could detect when the position of your text box (or its parent scroll viewer's offset) has changed, as this would indicate that the virtual keyboard has appeared or disappeared.
You can listen to the TextBox.GotFocus and TextBox.LostFocus events to detect when a text box in your application acquires and looses focus.
If an editable element gets focus then the framework will automatically scroll the element into view. So you really shouldn't have to do anything.
In a custom toolset I have installed for Visual Studio, there is a popup window that should appear to me so that I can manipulate one of the lists (an in-built editor). The component is Telerik, but I don't think that has anything to do with it (maybe).
The popup window is no longer popping up to me. I wonder if it got minimized or it's a z-index thing, where the window is behind VS? But this locks up VS, and I can't do anything within it until I cancel the window. But I can't cancel the window because I can't see it... and so that is really slowing me down and is really frustrating.
Is there a way to get around this? A key press to bring this to the front or give it the focus?
Thanks.
You should be able to cancel it with ESC. You can also test if you can find the window with CTRL-TAB. If this not help then an uninstall, boot and reinstall seems the only possible solution.
This might be a z-index issue indeed. Try using FireBug or IE dev toolbar to get a hold on the popup and its container and check their styles and z-indices.
Dick
Somehow, Expression Blend has entered full-screen mode (no window chrome), but I can still minimize/maximize/restore/move through the taskbar button. I don't see any menu options for full-screen mode, and the normal keyboard shortcuts don't work (F11, Alt-Enter).
I'm not sure how this happened, but I would sorely love to get my chrome back to make interacting with the window easier.
I've never seen a Full-screen mode in Blend. Maybe you accidentally hit Tab or F4 and did an Auto-hide to all of the panels?
you can press ESC button
in code use:
Application.Current.Host.Content.IsFullScreen = false;
check this
After not even trying to use Blend for my application for a really long time, it turns out it was my own fault to begin with. I had created a custom chrome control that would find its parent Window and remove the frame. I wasn't checking design mode, so whenever my control was instantiated by blend, it would remove all the chrome from the window :).