Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Thu, 21 Aug 2008 16:49:34 -0400,    group: microsoft.public.win32.programmer.ui        back       


Missing tab control focus rectangle   
I am trying to figure out how to work around a bug with a missing focus 
rectangle in a tab control:

My main application window is a dialog and contains a button.  When a user 
presses the button, the application creates a modal dialog whose owner is 
the main window.  The modal dialog contains a tab control which contains 
several child dialogs.

If the user uses the keyboard to press the button, then modal dialog opens 
and the tab control correctly draws a focus rectangle as soon as it receives 
focus.

However, if keyboard cues are off and the user uses a mouse buttons to press 
the button, then the tab control does not draw a focus rectangle until the 
user has pressed the Alt key.

Can anyone suggest how I might make the tab control draw the focus rectangle 
all the times that it should?

Thanks.

David Liebtag
date: Thu, 21 Aug 2008 16:49:34 -0400   author:   David Liebtag

Re: Missing tab control focus rectangle   
"David Liebtag" wrote:
> Can anyone suggest how I might make the tab control draw the 
> focus rectangle all the times that it should?

The problem is not only with the tab control. I tested it with 
other controls and the problem is the same: until you press Alt 
there is no focus rectangle around active control. You can check 
it with WordPad (View -> Options) or with Paint (Image -> 
Flip/Rotate or Ctrl+R).

What happens if you explicitly invalidate a window in focus?

Alex
date: Fri, 22 Aug 2008 00:24:47 +0300   author:   Alex Blekhman

Re: Missing tab control focus rectangle   
Alex,

You're not supposed to see a focus rectangle until you press Alt if the 
"Hide underlined letters for keyboard navigation until I press the Alt key" 
is checked in the Effects dialog from the Appearance page of the Display 
Properties notebook.  Is this option checked on your machine?  For me, other 
controls work properly whether or not it is checked.

David Liebtag
date: Thu, 21 Aug 2008 17:29:59 -0400   author:   David Liebtag

Re: Missing tab control focus rectangle   
Might the TCS_FOCUSONBUTTONDOWN tab control window style be the key?

Timo
-- 
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
date: Thu, 21 Aug 2008 23:37:21 +0200   author:   Timo Kunze

Re: Missing tab control focus rectangle   
"David Liebtag" wrote:
> You're not supposed to see a focus rectangle until you press Alt 
> if the "Hide underlined letters for keyboard navigation until I 
> press the Alt key" is checked in the Effects dialog from the 
> Appearance page of the Display Properties notebook.  Is this 
> option checked on your machine?  For me, other controls work 
> properly whether or not it is checked.

Yes, I know this option. It is enabled on my machine. However, 
after second thought I can see the reason behind this behavior. 
The focus rectangle provides visual clue where keyboard input will 
go. So, it kind of falls in the same category as underlined 
letters. Therefore, unless user decided to use keyboard and 
indicated his intention by pressing Alt the system hides all 
visual clues for keyboard input (including focus rectangle).

Alex
date: Fri, 22 Aug 2008 00:59:37 +0300   author:   Alex Blekhman

Re: Missing tab control focus rectangle   
Whether ot not I create the tab control with the TCS_FOCUSONBUTTONDOWN 
style, I get the same behavior.

David Liebtag
date: Thu, 21 Aug 2008 17:58:15 -0400   author:   David Liebtag

RE: Missing tab control focus rectangle   
I recently also had some issues with focus rectangle behavior - my goal was 
to never show any focus rectangles. I finally came across the 
WM_CHANGEUISTATE message, which is supposed to control focus rectangle 
behavior in dialogs. It took me some time to send and handle those messages 
appropriately, but finally the dialog did it my way. Maybe you should take a 
look on this message.

-- 
Gerd


"David Liebtag" wrote:

> I am trying to figure out how to work around a bug with a missing focus 
> rectangle in a tab control:
> 
> My main application window is a dialog and contains a button.  When a user 
> presses the button, the application creates a modal dialog whose owner is 
> the main window.  The modal dialog contains a tab control which contains 
> several child dialogs.
> 
> If the user uses the keyboard to press the button, then modal dialog opens 
> and the tab control correctly draws a focus rectangle as soon as it receives 
> focus.
> 
> However, if keyboard cues are off and the user uses a mouse buttons to press 
> the button, then the tab control does not draw a focus rectangle until the 
> user has pressed the Alt key.
> 
> Can anyone suggest how I might make the tab control draw the focus rectangle 
> all the times that it should?
> 
> Thanks.
> 
> David Liebtag
> 
> 
> 
> 
>
date: Thu, 21 Aug 2008 23:49:02 -0700   author:   Gerd Schneider

Re: Missing tab control focus rectangle   
Thank you!

Reading about WM_CHANGEUISTATE I now believe tab control is behaving 
properly.  The problem is that my custom draw check boxes are not and this 
leads to inconsistent behavior in my dialogs.

David Liebtag
date: Fri, 22 Aug 2008 08:43:40 -0400   author:   David Liebtag

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us