Dialog, tab key and focus rect problem

Dialog, tab key and focus rect problem

Post by Nicolas Ca » Thu, 27 May 2004 00:36:44


Hi,

I would like to understand the following native behaviour in a dialog box:

Wyou initially click on a control, it gains the focus but it doesn't display
a focus rect. Hit tab once or several times to come back to the control and
it displays a focus rect. Hit tab again to remove the focus from the
control, now click on it and it regains the focus but this time it displays
a focus rect.

So gaining the focus is not enough to display a focus rect. Hitting tab
fixes that once and for all.
Why this behaviour ?

I would like a focus rect in any case. Is there a solution ?

Thank you

Nicolas
 
 
 

Dialog, tab key and focus rect problem

Post by Nicolas Ca » Thu, 27 May 2004 20:48:26

Impressive. You're right.

Now, is there a programmatical way to override this setting in my program ?
Or a way to emulate the checkbox being unchecked ?

Thank you

Nicolas



display
and
displays

 
 
 

Dialog, tab key and focus rect problem

Post by Jeff Partc » Thu, 27 May 2004 21:48:54


?

One thing you can try doing to circumvent this behavior is to add a line
like...

PostMessage(WM_UPDATEUISTATE, MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS));

...just before you return from your WM_INITDIALOG handler.

--
Jeff Partch [VC++ MVP]