Sometimes, transparent static controls are very useful. For example, you have a dialog with a bitmap
in it and want to add some text in the picture. If you create a static control, your text will appear on an
opaque background, even if you've selected the
WS_EX_TRANSPARENT style (this style is *very*
How to implement
To use the class in your application you need to do the following:
- Insert the .h and .cpp files into your project.
- Add a static control into your dialog resource.
- Add a member variable for that static control.
- Modify the variable declaration.
- Don't forget the
#include at the top of the include file:
That's it. You should now have a transparent background.
The following Static Styles are implemented:
SS_CENTERIMAGE (center text vertically)
The various borders (
SS_SUNKEN, WS_EX_CLIENTEDGE, ...) are also supported.