Click here to Skip to main content
15,880,725 members
Articles / Desktop Programming / WTL
Article

Norm Almond CLabel Class Port to ATL/WTL

Rate me:
Please Sign up or sign in to vote.
3.00/5 (9 votes)
24 Jan 2001 74K   1.8K   27   7
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


    Written By
    Web Developer
    United Kingdom United Kingdom
    Was made redundant in early 2003 after 10 years in computer programming, since then started my own business (selling computer books on the net)
    www.pricecutbook.co.uk


    Comments and Discussions

     
    QuestionMissing include? Pin
    ChrisRibe27-Apr-06 9:10
    ChrisRibe27-Apr-06 9:10 
    AnswerRe: Missing include? Pin
    ChrisRibe27-Apr-06 9:41
    ChrisRibe27-Apr-06 9:41 
    QuestionForgets boldness on SetWindowText? Pin
    peterchen7-May-05 4:14
    peterchen7-May-05 4:14 
    GeneralThank You! Pin
    Agump21-Nov-04 22:09
    Agump21-Nov-04 22:09 
    GeneralGreat job... one small suggestion Pin
    Eugene Polonsky21-Dec-01 7:44
    Eugene Polonsky21-Dec-01 7:44 
    GeneralThanks Pin
    NormDroid17-Mar-01 3:36
    professionalNormDroid17-Mar-01 3:36 
    Thanks for the credits Rashid.


    GeneralSuggestion: Can it Port to SmartPhone ATL/WTL Pin
    fox28016-Feb-03 16:27
    fox28016-Feb-03 16:27 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.