help in pressing buttons

ljpv14

Active member
Joined
Nov 28, 2011
Messages
44
Programming Experience
3-5
I have a button in my windows form using vb.net when I actually clicked the button something happen then when I press any keys like enter or space, it focuses on the button since it was clicked and the codes in my button is the one that is executing rather than the codes in my enter or space key. I think it means that the button is being pressed when I hit spacebar and enter because there is a blue border in the button. When I click a button the focus remains on the button. I don't know how to remove that. Help please!
 
That is exactly how a Windows Form is supposed to work. That is pretty much universally how a Windows UI is supposed to work. If the user wants focus on some control other than the Button then they should click on that other control. This is standard Windows usage and should not come as a surprise to any Windows user, so they have no reason to complain about it.
 
I see. So I really need to change my control since having a button conflicts with what I want to happen. Thank you for the kind answer sir. :D
 
You should explain what you're actually trying to achieve and we can perhaps help you achieve it. It is possible to make your UI work in a non-standard way and maybe that's the best option but it may also be more confusing to more people than something more conventional.
 
What I want to achieve is to remove the focus on a clicked button and still be able to press keys after clicking a button without having the pressed key to execute the commands in the clicked button.
 
Back
Top