CBlendedButtonST v1.0

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

Yes!
This class is included in the latest SoftechSoftware DLL version.

 

Description

CBlendedButtonST is a CButtonST-derived class that adds blended (semi-transparent) background to your buttons !

Main CBlendedButtonST features are:

How to integrate CBlendedButtonST in your application

In your project include the following files:

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

// Create the IDC_BTNTEST control
m_btnTest.SubclassDlgItem(IDC_BTNTEST, this);
Or in your DoDataExchange:
// Call the base method
CDialog::DoDataExchange(pDX);

// Create the IDC_BTNTEST control
DDX_Control(pDX, IDC_BTNTEST, m_btnTest);
Attention!
To properly work the CBlendedButtonST 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_BTNTEST control
(...)

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

Class methods

SetBackgroundColor
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:
//      BTNST_OK
//          Function executed successfully.
//
DWORD SetBackgroundColor(COLORREF crBackgroundColor, BOOL bRepaint = TRUE)
SetBorderColors
Sets the control's border colors.
// Parameters:
//     [IN]   crBorderTopLeft
//            A COLORREF value indicating the color of the top and left sides of control's border.
//     [IN]   crBorderBottomRight
//            A COLORREF value indicating the color of the bottom and right sides of control's border.
//     [IN]   bRepaint
//            If TRUE the control will be immediately repainted.
//
// Return value:
//      BTNST_OK
//          Function executed successfully.
//
DWORD SetBorderColors(COLORREF crBorderTopLeft, COLORREF crBorderBottomRight, BOOL bRepaint = TRUE)
SetOpacityPercentage
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:
//      BTNST_OK
//          Function executed successfully.
//
DWORD SetOpacityPercentage(BYTE byPercentage, BOOL bRepaint = TRUE)
GetVersionI
Returns the class version as a short value.
// Return value:
//     Class version. Divide by 10 to get actual version.
//
static short GetVersionI()
GetVersionC
Returns the class version as a string value.
// Return value:
//     Pointer to a null-terminated string containig the class version.
//
static LPCTSTR GetVersionC()

History

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.