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
"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
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
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."
"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
Whether ot not I create the tab control with the TCS_FOCUSONBUTTONDOWN style, I get the same behavior. David Liebtag
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 > > > > >
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