MFC class "Tip of the Day" like WinZip | CodeGuru

MFC class “Tip of the Day” like WinZip

Environment: VC6 This control CStartupTip helps to create a dialog “Tip of the Day” like WinZip “Tip of the Day”. It splits tip text into strings and displays these strings in special multi-line window. CStartupTip is derived from CStatic.  Usage: Include StartupTip.cpp and StartupTip.h in your project Create new CStartupTip class object (for example, m_tip) […]

Written By
CodeGuru Staff
CodeGuru Staff
Feb 12, 2002
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Environment: VC6

This control CStartupTip helps to create a dialog
“Tip of the Day” like WinZip “Tip of the Day”. It splits tip text
into strings and displays these strings in special multi-line window.
CStartupTip is derived from CStatic.
 

Usage:

  1. Include StartupTip.cpp and StartupTip.h in your project
  2. Create new CStartupTip class object (for example, m_tip) and
    just invoke create function like you create a standard CStatic object.
  3. Set tip text, icon and parameters of the control:
    BOOL CTipsDlg::OnInitDialog()
    {
       ...
       // TODO: Add extra initialization here
       m_tip.SetMaxLen(40);
       m_tip.SetTipText("This is a test");
       m_tip.SetIcon(IDR_TIPICON);
    
       return TRUE;
    };
    
  4. Call SetTipText or SetIcon to change text or icon

 
Member functions:
 

  • SetTipText(LPCTSTR lpText) – set the text of the tip. The text will be splitted
    into strings (maximum 10) bounded by whole word. The words must be
    separated by spaces. Maximum lenght of the text depends on maximum
    symbols in the string that is defined by SetMaxLen function
  • SetMaxLen(int n) – set the maximum lenght (in symbols) of the string.
    The string must be no more than 100 symbols. Default is 50 symbols.
  • SetIcon(UINT n) – set an icon in the LeftPane. n – resource id of the icon.
  • SetLeftPaneColor(COLORREF color) – set a color of the LeftPane.
    Default is RGB(132,130,132)
  • SetBgColor(COLORREF color) – set a background color
    Default is RGB(255,255,255)
  • SetLeftPaneSize(int n) – set a size of the LeftPane.
    Default is 50 pixels

Downloads

Download demo project – 14KB Kb

Download source – 3KB

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.