CBlendedStaticST v1.0

A CStaticST-derived control with blended (semi-transparent) background!

This class is included in the latest SoftechSoftware DLL version.


CBlendedStaticST is a CStaticST-derived class that adds blended (semi-transparent) background to your static texts !

Main CBlendedStaticST features are:

How to integrate CBlendedStaticST in your application

In your project include the following files:

Create a CBlendedStaticST object statically
With dialog editor create a standard static control called, for example, IDC_STCTEST (you don't need to make it owner drawn) and create a member variable for this control:
CBlendedStaticST m_stcTest;
Now attach the control to CBlendedStaticST. For dialog-based applications, in your OnInitDialog:
// Call the base-class method

// Create the IDC_STCTEST control
m_stcTest.SubclassDlgItem(IDC_STCTEST, this);
Or in your DoDataExchange:
// Call the base method

// Create the IDC_STCTEST control
DDX_Control(pDX, IDC_STCTEST, m_stcTest);
To properly work the CBlendedStaticST control MUST be in transparent mode and MUST have a opaque percentage lower than 100%. After creation you can set these parameters into your OnInitDialog, for example:
// Create the IDC_STCTEST control

// Set background color
m_stcTest.SetBackgroundColor(RGB(69, 162, 54), FALSE);
// Set opacity percentage to 50%
m_stcTest.SetOpacityPercentage(50, FALSE);
// Set transparent mode

Class methods

Sets the control's background color.

// Parameters:
//     [IN]   crBackgroundColor
//            A COLORREF value indicating the new control's background.
//     [IN]   bRepaint
//            If TRUE the control will be immediately repainted.
// Return value:
//          Function executed successfully.
DWORD SetBackgroundColor(COLORREF crBackgroundColor, BOOL bRepaint = TRUE)
Sets the percentage of opacity of the control's background.
// Parameters:
//     [IN]   byPercentage
//            Percentage (from 0 to 100)
//            0 = Full transparency
//            100 = Full opacity
//     [IN]   bRepaint
//            If TRUE the control will be immediately repainted.
// Return value:
//          Function executed successfully.
DWORD SetOpacityPercentage(BYTE byPercentage, BOOL bRepaint = TRUE)
Returns the class version as a short value.
// Return value:
//     Class version. Divide by 10 to get actual version.
static short GetVersionI()
Returns the class version as a string value.
// Return value:
//     Pointer to a null-terminated string containig the class version.
static LPCTSTR GetVersionC()


Disclaimer and usage terms

The software and the accompanying files are distributed "AS IS" and without any warranties whether expressed or implied. No responsibilities for possible damages or even functionality can be taken. The user must assume the entire risk of using this software.
The sample application and the source codes (where available) are for demostration purposes only. You are not allowed to use the demo source codes, libraries and DLLs in any of your application. If you like this software you must buy the full version.
Downloading anything from this site means you accept the above terms.