|
-
April 21st, 1999, 12:44 PM
#1
How to set the focus to a previous control?
How can I determine what control on a view had focus before it is switched to a button that is clicked? I have buttons that are used to navigate through pictures. When they are clicked and have finished whatever they need to do, I want to set the focus to the control that previously had the focus before the button was clicked. Is this possible? Calling CWnd::Getfocus from the OnButton function return the control of the button. Maybe I could use the KillFocus message to set a CWnd * member of the view to the control that is loosing focus and then set the focus back to that CWnd * as the last step of the OnButton function. Any better ideas?
Thanks,
Steve
Steven M. McNeese
[email protected]
-
April 21st, 1999, 04:51 PM
#2
Re: How to set the focus to a previous control?
I think you can handle OnSetFocus (WM_SETFOCUS message) as it gives the CWnd object that loses input focus. This implies that you override (subclass) your buttons in order to handle this message. Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|