How do I set a CONTROL to have the keyboard focus?

Started by Quin, June 12, 2024, 03:03:27 PM

Previous topic - Next topic

Quin

Oh, I see. Thanks much, that worked!
Side note, you just blew my mind, I didn't know there was a version of the Windows API documentation in CHM format! Oh my, where has this been hiding all my life?

MrBcx

Quote from: Quin on June 12, 2024, 03:03:27 PM
Sorry if this is obvious, I'm still getting used to this documentation structure, and a search on the forum/in the CHM didn't help me. Is it possible for me to set a control as the default (e.g. the focus is placed there by default and you can type/tab from there) in my LOADFORM sub?
Thanks!

The Win32API is pretty useful, so most of that is not duplicated in BCX's lexicon.

To answer your question, just use SetFocus ( Your_Window_Control_Handle )

Quin

Sorry if this is obvious, I'm still getting used to this documentation structure, and a search on the forum/in the CHM didn't help me. Is it possible for me to set a control as the default (e.g. the focus is placed there by default and you can type/tab from there) in my LOADFORM sub?
Thanks!