(I would say hello here, but Stackoverflow always removes it for some reason)
My problem is that on my Visual Basic form the button that I use to close the form can be triggered by the enter key. This is a problem because my form opens a webpage that frequently uses forms, meaning that the enter key on a form will close the window!
Therefore, I need to find a way of stopping the focus on this button. It is a custom-ish button and is its own class but inherits from a normal button. Here's some diagrams:
Stage 1: Before the user focuses on the WebKitBrowser

Stage 2: After the user focuses on the WebKitBrowser

As you can see, the button is "focused" with a white border, similar to a normal Windows button where the border is instead blue. If I was to press enter at this stage, the form would close.
In conclusion, or TL;DR, how do I stop my close button from being focused?
How do I stop a button from triggering when the enter key is pressed? (focused)
1.5k Views Asked by Billy At
1
There are 1 best solutions below
Related Questions in VB.NET
- If...Then...Else Visual Basic 2012
- Detecting whether a mouse button is down in vb.net
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- vb.net Get PrivateMemorySize64 and process id sort by memory size
- Cannot insert values into database
- check validation of an expression with Regex
- VB.NET KeyNotFoundException from String()
- How do i display data that are in between 2 values in a DDL?
- VB.net: How to make original variable value fulfill 2 statements?
- Login form by using a new database, made in VB
- Get Text from listbox in VB.net
- error handing for uploading large size file
- XML Null Element Visual Basic
- Using chart and tooltip
- vb2010 Express - Operator '=' is not defined
Related Questions in FORMS
- Twitter Bootstrap horizontal form elements on a line
- posting javascript populated form to another php page
- Call a method in a .cs from javascript
- HTML5 form input reacting to enter key
- Why HTML5 required field is not mandatory, if form posted to two different pages using JavaScript?
- django form errors before submit
- PHP Contact Form returning error upon submission
- PHP form validation: Where to plop the code
- javascript check input fields are not blank and check input field length?
- Show success or error messages in Ajax response to Wordpress custom registration form
- Google forms to SMS
- SilverStripe - Multilingual Custom Form Template
- Backbone.Marionette + Rails app redirects after form submission. Why?
- Array not returning default value set over 1,000,000 when using jquery fancy comma script
- How to submit after using ng-repeat, ng-form and ng-submit
Related Questions in BUTTON
- change content button with trigger
- PHP like button(counter) inside a table
- How can I make a button who draws a line
- Scrollable webpage navigation
- Two checkbuttons to toggle sound not working right
- HTML Button Link to Website from Text
- Unity - Gui Button issues (Android)
- I can't click the finish button it seemed to be like disabled or something
- Button Visibility in WPF at startup
- Changing background of button every second
- How do I convert point to local coordinates?
- Flash CS3: Text appears on button mouse over or text mouse over
- Android : Unable to change width of dynamic button
- Change button background with an action
- Android how am I supposed to get text using button
Related Questions in FOCUS
- if input has focus open keypad in iphone
- Setting focus to input box in an InputDialog using MahApps
- Android Focus issue between EditText and CheckBox
- Gtk sharp focus history?
- How to Prevent TMainMenu from Taking Focus from Floating Window
- QtQuick2 - QML reusable item focus changes when selecting/clicking outside/inside of root item
- Check if an input field has focus in vanilla JavaScript
- How do I stop a button from triggering when the enter key is pressed? (focused)
- Div focus using css
- Set JAWS cursor focus programmatically
- How to make my custom control be notified when his form or application receives and loses focus?
- blur/focusout doesn't work
- Firefox .on('focusin') not working for image?
- Ionic Framework Keyboard hides input field
- Focusing on <input type=number> in Android browser the page scrolls to the bottom
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Your button by default is included in the tab order which results in the focus effect.
Try removing the button from the tab order. You can do by setting the
TabStopof your button toFalsewhen your form loads. I tried the example below and it worked for me.Before
Code:
After
Code:
End Class