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:

  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


Comments

  • Very nice!

    Posted by Legacy on 11/19/2002 12:00am

    Originally posted by: WishYou

    This was a very cool control. Plain and simple, but still very usefull.

    I've made some small modifications to make it fit my application, but no big things...

    Thanx!!!

    Reply
  • Serialization code needed to make it complete.

    Posted by Legacy on 02/14/2002 12:00am

    Originally posted by: Stan

    Nice example.
    It would be more useful if the example contained code for serializing tips either by using CArchive or by providing a simple reader/writer to access a string file.
    Last shown string should be tracked, ShowNextTip() should be implemented.
    Apart from that - it's nice.

    Reply
  • this is not unicode

    Posted by Legacy on 02/12/2002 12:00am

    Originally posted by: Ummite

    This is not unicode aware... At least, do _T("test here")!

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • On-demand Event Event Date: March 19, 2015 The 2015 Enterprise Mobile Application Survey asked 250 mobility professionals what their biggest mobile challenges are, how many employees they are equipping with mobile apps, and their methods for driving value with mobility. Join Dan Woods, Editor and CTO of CITO Research, and Alan Murray, SVP of Products at Apperian, as they break down the results of this survey and discuss how enterprises are using mobile application management and private app stores to …

  • There is no understating the impact of security and network connectivity on today's cloud environments. Yes, clouds can scale, expedite processing, and reduce costs, but they also incur risks associated with multi-tenancy, availability, and access control. How users connect to the cloud is vital because not only are security risks non-negotiable, but performance, flexibility, and reliability are critical as well, which leads to a heavy emphasis on combining strong security with private network ecosystems. …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date