provided by: 
Originally published at Internet.com
New Label Class Demo Dialog This class (CNewLabel) is derived from CStatic and performs a lot of things that the CStatic class can not do: * Text colour * Background colour * Text background colour * Fonts * Multi line support with text justification * Link text (with or without cursor) * Text highlighting when mouse moves over static control * Centred background image (stretched or not with or without text) * Text rotation (00 - 900 - 1800 - 2700) (separated CTextRotator class) * Bevel lines support * Text flashing * Background flashing * Control tool tips (separated CControlToolTip class)
CNewLabel API
// Colour functions //Set the background colour of the control. CNewLabel& SetBkColor(COLORREF clr) //Set the text colour of the control. CNewLabel& SetTextColor(COLORREF clr) //Set the background colour of the text background. CNewLabel& SetTextBackColor(COLORREF clr) //Set the highlighting colour. CNewLabel& SetHighLightColor(COLORREF clr) //Set the control to use the default background colour (COLOR_3DFACE). CNewLabel& SetDefaultBkColor() //Set the control to use the default text colour (COLOR_WINDOWTEXT). CNewLabel& SetDefaultTextColor() //Set the control to use the default text background colour (COLOR_3DFACE). CNewLabel& SetDefaultTextBackColor() // Font functions //Toggles the state of the bold attribute of the text in the control. CNewLabel& SetFontBold(BOOL bSet) //Toggles the state of the italic font attribute of the control. CNewLabel& SetFontItalic(BOOL bSet) //Toggles the state of the underline font attribute of the control. CNewLabel& SetFontUnderline(BOOL bSet) //Sets the fonts face name. CNewLabel& SetFontName(LPCTSTR lpszFaceName) //Sets the fonts size in points. CNewLabel& SetFontSize(int iSize) // Other functions //Toggles the state of the background flashing attribute. CNewLabel& FlashBackground(BOOL bActivate, UINT uiTime) //Toggles the state of the text flashing attribute. CNewLabel& FlashText(BOOL bActivate, UINT uiTime) //Set the text justification (see under for defines). CNewLabel& SetAlignment(UINT uiAlign) //Set the text rotation angle (0, 90 , 180 or 270). CNewLabel& SetAngle(UINT uiAngle) //Set (or remove) the background image. CNewLabel& SetBackImage(UINT nID) //Toggles the state of the borders attribute. CNewLabel& SetBorder(BOOL bSet) //Set the control cursor. CNewLabel& SetCursor(HCURSOR hCursor) //Set the control cursor. CNewLabel& SetCursor(UINT uiCursorID) //Toggles the state of the disabled attribute. CNewLabel& SetDisabled(BOOL bSet) //Toggles the state of the link attribute. CNewLabel& SetLink(BOOL bSet) //Sets the cursor for the link. CNewLabel& SetLinkCursor(HCURSOR hCursor) //Sets the cursor for the link. CNewLabel& SetLinkCursor(UINT uiCursorID) //Toggles the state of the lower case attribute. CNewLabel& SetLowerCase(BOOL bSet) //Set the text of the control. CNewLabel& SetText(LPCTSTR lpszText) //Set the tool tip position (0 = Over, 1 = Under, 2 = Above). CNewLabel& SetToolTipPosition(int iPos) //Set the tool tip text. CNewLabel& SetToolTipText(LPCTSTR lpszText) //Toggles the state of the sunken attribue of the control. CNewLabel& SetSunken(BOOL bSet) //Toggles the state of thhe upper case attribute. CNewLabel& SetUpperCase(BOOL bSet) //Toggles the state of the vertical text attribute. CNewLabel& SetVerticalText(BOOL bSet) //Toggles the state how the tool tip must appear. CNewLabel& ShowToolTipOnlyOnMouseClick(BOOL b) //Stretch or not the centred bitmap. CNewLabel& StretchBitmap(BOOL bStrecth) //Display or not the bevel line. CNewLabel& UseBevelLine(BOOL bUse) //Toggles the state of the highlighting mode. CNewLabel& UseHighLighting(BOOL bUse) //Use tool tip or not. CNewLabel& UseToolTip(BOOL bUse) //Use highlighting only with a filled tool tip. CNewLabel& UseHighLightingOnlyWithMouseToolTip(BOOL b) //Use left mouse button for tool tip. CNewLabel& UseLeftMouseButtonForToolTip(BOOL bUse) For GET functions, see source code! ...
Read article at Internet.com site