Dismiss Numeric Keyboard WP8 in Code Behind (VB) - textbox

So I have a Numeric Keyboard for entering a few numbers and according to other apps and questions the best way to put a Done/Cancel button is with the Application Bar which I have already setup without any issues. My only problem now is that when I do click on the done or cancel button I want to dismiss the keyboard as well but I can't seem to figure this part out. I've seen a few other posts say to use this.Focus(); but that's for C# and I'm using VB instead and so far haven't been able to find a similar function.

The page still has a method called 'Focus()' in VB. The problem is that:
(C#) this is (VB) Me
So, it's:
Me.Focus()
Or, simply:
Focus()

Related

Predicitve text/suggestion above keyboard doesn't work?

My whole Xcode project has a weird behaviour,dont know what is causing this issue I am getting prediction and suggestions above my keyboard, but when I click on the text it doesn't call any method or when I try clicking on the predicited text it doesn't work.
is there by chance because of using third party pods?have tried all types of textContentType I get suggestion like name,phonenumber,otp but unfortunately when I tap on it it doesn't work
its behaviour is literally like the predicition has user interaction disabled

Xamarin PCL intercept menu back button pressed

There seems to be quite a lot of buzz on the web about this issue for iOS. I have examined a few articles but a lot of them are dated quite a while ago so maybe there is some fresh info.
I have a PCL project and an iOS project in Xamarin forms. The code is 99% in the PCL. I want to override the back button pressed event. I mean the back button in the top standard iOS menu.
Here are some solutions that I came across.
1) The OnBackButtonPressed() only works for hardware button on Android.
2) The only other way I found here https://theconfuzedsourcecode.wordpress.com/2017/03/12/lets-override-navigation-bar-back-button-click-in-xamarin-forms/ is to override the back button click on the default back button in the UINavigationBar.
3) Use OnDissapearing but I can't do that because I only want to implement an event when navigation occurs to a previous page but OnDissapearing fires out if we navigate forward as well.
I wonder if there might be a simple elegant quick way that I didn't come across that some one is using. Thanks.

How to navigate BlackBerry BrowserField2 in OS5

I am using the new BrowserField2 in BlackBerry OS5 to display HTML content in my app. There are 3 options available for navigation through links in that content.
CURSOR navigation uses a block cursor and actually moves through the characters of the page. Not very useful for me.
POINTER navigation uses a mouse like pointer that you move around the screen and hover over elements. This could work but there is a bug however in that the browser field captures navigation and never lets go so this mode is effectively broken if you share a screen with any other managers. Once your focus enters the browser field you cannot move focus back out and into neighboring fields. RIM has acknowledged the bug but has no work around.
NONE which is for custom navigation but they offer no explanation as to how you would do this.
What I ideally want is to simply have trackpad movements move the focus through the links and highlight them. Then a click would activate the link. I assume I would select the NONE option above and implement my own focus navigation but I am not clear how this can be accomplished with the new APIs.
Is anyone familiar with the new browser2 component could give some guidance?
Thanks!
There's a workaroudn to getting back the focus out of the BrowserField using the NAVIGATION_POINTER.
I found it in this thread:
http://supportforums.blackberry.com/t5/Java-Development/BrowserField-2-Navigation-Mode/td-p/632172
"farahh" posted this:
I found out a hack..
with the navigation set to pointer mode, a click outside the browserfield manager invokes Manager.invokeAction(int). I used the getFieldWithFocus to verify which field has focus and then switch the focus to something else.
Cheers.
Nahuel
PD: i havent found out how to get the behaviour you want, i need that as well so if you got it working please let me know, its kinda urgent in my project =(
I actually reverted back to the older browser1 (OS4) component because the navigation problems in browserField2 (OS5) were a deal breaker for me. Luckily the OS4 browser does everything I need in terms of functionality and it has the exact navigation behavior I need and there are no focus problems mixing it with other views.

J2me Blackberry Numeric Input

I am developing a blackberry application using j2me and LWUIT (blackberry port). Everything works great except for the TextField in numeric mode. Basically when you have focus on the TextField you have to first go into "NUMERIC" mode (by pressing alt + aA) in order to input, which is not user friendly and a problem.
The proposed solution is to use a TextArea instead that allows you to open a NATIVE type input box. The problem there is that the user needs to focus the field and then press the fire button which again is unfriendly.
Does anyone know of any simple solutions?
The few solutions i have in mind (but not sure how to do them):
1) Capture any keypress on the TextArea and go into NATIVE mode, instead of just the fire key.
2) Put the blackberry input mode into numeric using code for the whole form.
Any advice will be appreciated.
Many Thanks,
Paul
I'm not sure whether this solution is one that would appeal to your needs or not, but you could add j2me onKeyPress handling that "translates" the letter keypresses into the numbers that correspond to the same key and adds the "correct" number to the textfield instead of what the user actually pressed. Do keep in mind that such a solution would require you to worry portability issues as far as not all blackberry models using the same keyboard layout (qwerty vs. reduced qwerty for example) and handling the variation in layouts sufficiently.
Okay well to answer my own question.
I overrided the keyRelease method on a TextArea. And in this method if the keypress is not an arrow key i the call editString method (this causes the native textfield to open). The only downside to this is that it will always miss the first keypress in the text box.

Delphi "Tray" icon (NotifyIcon) context-menu does not disappear when clicking outside it

I'm trying to show a popup menu when right clicking my Notification Icon, which works fine; But I want the menu to disappear when the user clicks outside of that menu.
It's supposedly by design as per KB135788 - PRB: Menus for Notification Icons Do Not Work Correctly (archive).
But no decent app I know of behaves like this. I've tried calling SetForegroundWindow using the popup menu's handle to no avail. I'm sure it's possible to work around this, as I've done it years ago but don't remember how.
Anyone know how to achieve the expected behaviour?
I've found a solution!
I was calling
SetForegroundWindow(PopupMenu1.Handle);
Which doesn't work, but changing this in the OnPopup event handler to
procedure TForm1.PopupMenu1Popup(Sender: TObject);
begin
// Hack to fix the "by design" behaviour of popups from notification area icons.
// See: http://support.microsoft.com/kb/135788
BringToFront();
end;
Works!
Obviously, if the form is visible when this is called, your app will jump foremost, but if it's hidden (as mine is), then it'll work.
I'd be interested to know if there's a way to make the menu work right without the window jumping foremost, though.

Resources