Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Norm Almond CLabel Class Port to ATL/WTL

0.00/5 (No votes)
24 Jan 2001 2  
A fully stocked owner drawn CStatic class for WTL
  • Download source files - 7 Kb
  • Download demo project - 28 Kb
  • Sample Image - ATLLabel.jpg

    Introduction

    Now you can use Norm Almond's excellent CLabel class in your ATL/WTL projects. The Class is still called CLabeland it retains a majority of the original code. Just follow these simple instructions.

    1. Create a WTL Project
    2. Design the dialog and add the Static Controls
    3. Add the ATLLabel.h header file to your project
    4. Any static controls that need enhancing, give each control a unique ID within the dialog editor.
    5. Assign a CLabel to each static control.
    6. Subclass each member controls (CLabel) to each ID using the SubclassWindow method.
    7. In OnInitDialog uses the CLabelmethods 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

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here