Download source files - 7 Kb
Download demo project - 28 Kb
Introduction
Now you can use Norm Almond's excellent CLabel
class in your ATL/WTL projects.
The Class is still called CLabel
and it retains a majority of the original code.
Just follow these simple instructions.
- Create a WTL Project
- Design the dialog and add the Static Controls
- Add the ATLLabel.h header file to your project
- Any static controls that need enhancing, give each control a unique ID within the dialog editor.
- Assign a
CLabel
to each static control.
- Subclass each member controls (CLabel) to each ID using the
SubclassWindow
method.
- In
OnInitDialog
uses the CLabel
methods to change the appearance of the control.
CLabel m_ctlGradient;
m_ctlGradient.SubclassWindow(GetDlgItem(IDC_GRADIENT));
m_ctlGradient.SetBkColor(RGB(255,255,255),RGB(0,0,255), CLabel::Gradient);
See Norm Almond's original CLabel
article for more details.
http://www.codeproject.com/staticctrl/clabel.asp