Disabling Enter Key while MsgBox is Open in VB - vb.net

When users are working they press the Enter Key very fast because that way they go through the form to the Accept Button at the end of the form. There is a MsgBox with Yes And Now , that opens as a last step before the form closes. That way with fast pressing multiple times the Enter Key the user accidentally presses Yes, coz the default button is Yes. Setting the default Key to No is not option.
So is there any way to dont allow pressing enter in the msgbox?

Related

VB setFocus after Typing in Textbox without losing it

I have a login screen where I set the focus to be on the password textbox so that the user can start typing their password without clicking anything.
I want to set the focus to the login button as soon as a character is typed into the password textbox so that the user can just hit Enter when they're done typing in the password.
I don't want to lose focus on the password textbox, but I want the login button to be highlighted so that you can hit Enter.
Right now I have to hit Tab, then Enter for this to work.
Set the Form.Accept Property of your Form to the Button's Name:
Gets or sets the button on the form that is clicked when the user
presses the ENTER key.
Then when the user is done entering their password and hits enter your button will be clicked automatically for them.
Figured it out. Went to the Property Sheet for the Login button and the Default property was set to No. Changed it to Yes and it works perfectly. Thanks.

How to make text box accept Return key function (used for Browser)

I want to know how to make my Text box (or Address bar) accept the Return/Enter key as a form of submitting a search.
Currently I have a button which submits the search, and not the textbox itself.
Thanks.
Currently I have a button which submits the search, and not the
textbox itself.
Assuming WinForms, set the AcceptButton property of your Form to that Button. Now when you hit enter the button will be automatically clicked for you:
Gets or sets the button on the form that is clicked when the user
presses the ENTER key.

VB.net suggestions to avoid keyloggers spy on my textbox password?

How it could be done?
So far i seen on Google:
Virtual keyboard
Add some events to my textbox to cancel the key event.
When key pressed record what has been pressed save and then simulate other 10 random keys?
what else can be done and not to build the whole anti-keylogger antivirus.
It can be done anything that your imagination let you:
You could tell the user to put his/her password using the key in the direction you want, for example on the right. And control the symbols with your application (with a Dictionary for example). You could show a standart keyboard picture to the user to be sure.
You could tell the user to put a letter you show to him/her every X keys pressed, or just press any key he/she wants and discard it.
You could tell the user to put a letter you show to him/her after each key of password pressed.
You could tell the user to put only the even characters of his password, and later ask for the rest.
You could tell the user to put the password backwards.
But I think a Virtual Keyboard is the best option.

Using Enter key to invoke different methods in Mac(objective c)

I am new to Objective c programming. I have created an application which has a UI with two buttons "Cancel" and "Ok". On clicking "Cancel", the application must terminate and clicking "Ok" must perform some task. Everything works fine. I am able to tab between these buttons and can call the required functionality by clicking space button.
All I want to do is, that when focus is on "Cancel" button(using tab key) then on clicking enter button from keyboard, my application should terminate and similarly, when focus is on "Ok" button then clicking enter should perform the desired functionality.
I have even set the 'setKeyEquivalent" property of the "Ok" and "Cancel" button, but I can only set unique keyequivalents. I also tried to read the title or tag value of the buttons and then call the required functionality but it didn't worked too.
Can someone please guide me how can I use enter button to invoke different functions depending upon the selected button in UI.
I think you don't want to set key equivalents for the buttons. You would want to override keyDown: and test for the enter key, then do the appropriate thing depending on which button had focus (which I think you could determine using NSWindow's firstResponder method).

Invoking a method on Space bar or Enter Press + MAC APP

I am developing a mac standalone app.
I want to let user press enter on search button to get result from DB.
Is there any way we can give control to search when user presses 'Enter Key'.
It works great on 'Space Bar'.
How can it be possible on 'Enter Key' in objective C.
Just set your button's "key equivalent" to the return key. To do that, select your button in the Interface Builder, open the inspector, and look for the entry labeled "key equivalent". Click it, and hit the return key. That's it!
But if you have a search box already, it's usually a better idea to do away with the search button. For example, Safari's Google search field doesn't have a "Google Search" button. Instead, hitting the return key at the end of the search phrase automatically triggers the search. If you want to do that, you just need to set the target and the action for the search box.