How to Stop Button Retaining Focus?

How to Stop Button Retaining Focus?

Post by Tom We » Fri, 14 Apr 2000 04:00:00



My appliction (written in C) has a bunch of text buttons above a
text entry area.  I want the focus to remain with the text area.  
If a user presses a text button, the generated WM_COMMAND in the
parent window returns the focus back to the text area.  

However, if the user presses on a text button, slides the mouse
off the button and then releases the mouse button, the button gets
focus but doesn't send any message to the parent window and the
text button retains the focus, causing the users typing to be ignored
until they accidentally hit space...

Merely returning the focus to the text area whenever it loses it stops
the tex buttons from ever firing!

Does anyone have any solution to preventing a regular button from
retaining focus?

 
 
 

1. How to stop button from retaining focus?

My application (written in C) has a bunch of text buttons above a
text entry area.  I want the focus to remain with the text area.  
If a user presses a text button, the generated WM_COMMAND in the
parent window returns the focus back to the text area.  

However, if the user presses on a text button, slides the mouse
off the button and then releases the mouse button, the button gets
focus but doesn't send any message to the parent window and the
text button retains the focus, causing the users typing to be ignored
until they accidentally hit space...

Merely returning the focus to the text area whenever it loses it stops
the tex buttons from ever firing!

Does anyone have any solution to preventing a regular button from
retaining focus?

                                        Tom West
-----------------------------------------------------------------------------

Technical Support Manager       |  Phone : (416) 978-8363
Holt Software Associates Inc.   |  Fax   : (416) 978-1509
-----------------------------------------------------------------------------

2. IBM TCPIP and 3com Etherlink II

3. retain or not retain on init?

4. Advanced CM11a Development

5. Toolbar Buttons do not retain their color.

6. Need C# ASP.NET developer with WPF/Austin,TX/9+months

7. Retaining information on form after clicking the back button on Internet Explorer 6

8. What equipment is MACNode?

9. Popup window steals owner's focus -- make it stop

10. How to stop the caret from hiding when window looses focus?

11. Button focus question

12. Disabled OK button still has "focus"

13. Button's focus rectangle