Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > Carbon > Human Interface Toolbox >

Why isn't my Static Text Control deactivating when my other controls are?


Q: Why isn't my Static Text Control deactivating when my other controls are?

A: Actually the Static Text Control (kControlStaticTextProc = 288) is deactivating as all other controls are when the window is deactivating.

Due to compatibility reasons with some applications, it keeps being displayed in black, whereas all other controls are appropriately being dimmed (grayed). This behavior only appears when no theme window background brush has been applied to the window. The obvious workaround is thus to set a theme window background brush (although only Dialog, Alert, and ModelessDialog brushes are currently fixing that problem) for your window and then your Static Text Control will also be dimmed (grayed) when deactivated.

If the previous workaround is not applicable because your application cannot or does not want to set a theme window background brush, you can use SetControlColorProc to set a ControlColorProc on the static text control; in your color proc, watch for the kControlMsgApplyTextColor message, and set up the text color appropriately for the state of the control and the state of the window; you could use SetThemeTextColor, passing either kThemeTextColorDialogActive or kThemeTextColorDialogInactive, depending on whether the control is active or inactive.


[Mar 11 2002]