Arrow keys and button focus

cbreemer

Well-known member
Joined
Dec 1, 2021
Messages
188
Programming Experience
10+
This is probably an easy question, and possibly a stupid one... but I've been searching and could not find an answer.
When I have a form with a number of buttons, pressing the arrow keys cycles through the buttons, giving each one of them focus in turn. How can I prevent that ?
I want to use the arrow keys for other purposes. Well I already do, and that works, but they STILL cycle through the buttons as well...
Looking at the button parameters I don't see anything that might help. I already have TabStop=false and TabIndex=0 on all buttons.
 
Thanks, that looks very interesting. Although I was rather hoping not to have to go into these intricacies and bother with Windows messages.... I thought there might perhaps be some setting in the form or buttons that would prevent this ?
 
Look into overriding ProcessDialogKey.
 
Thanks guys. I remember seeing this article before here, and thinking "yeah, indeed rather more than I want to know" :D If ProcessDialogKey does not provide a solution I may have to study it yet. Or maybe do that anyway.
 

Latest posts

Back
Top Bottom