Tip-Static control like 'Outlook Today's Tip'

Sample Image

Environment: VC6 SP2, NT4 SP5, CE 2.11, Windows Y2K

This Tip-Static control very smoothly show and hide Today's tip.
I think this control is so simple and useful.
Just use it!!

Usage

  1. Include TipStatic.cpp and TipStatic.h in your project.
  2. Create a new CTipStatic class object and just invoke Create function.
    
    	In your header file.
    	
    	#include "TipStatic.cpp"
    	
    	class CMyDialog : public CDialog
    	{
    	
    	....
    	// Attributes
    	protected:
    		CTipStatic m_ctrTipStatic;
    		
    	};
    	
    	
    	In your cpp file.
    	
    	int CMyDialog::OnCreate(LPCREATESTRUCT lpCreateStruct) 
    	{
    		if (CDialog::OnCreate(lpCreateStruct) == -1)
    			return -1;
    	
    		m_ctrTipStatic.Create("TipStatic",WS_VISIBLE|WS_CHILD,
    			CRect(10,10, 100,120),this, IDC_TIP_STATIC);
    
    		....
    			
    		return 0;
    	}
    
  3. Initialize CTipStatic class object by using AddTip(), SetSliderColor(), SetSliderMode().
    
    	BOOL CStaticTipDlg::OnInitDialog()
    	{
    		CDialog::OnInitDialog();
    		
    		....
    
    		// TODO: Add extra initialization here
    	
    		// Add Tip..
    		m_ctrTipStatic.AddTip("Hi\n Welcome to Cool-Tip Static!!\n\nSmile Seo");
    		m_ctrTipStatic.AddTip("Second.. Tip");
    		m_ctrTipStatic.AddTip("Third.. Tip");
    
    		m_ctrTipStatic.SetSliderColor(GetSysColor(COLOR_3DFACE));
    		m_ctrTipStatic.SetSliderMode(TRUE);
    
    		....
    		
    		return TRUE;  // return TRUE  unless you set the focus to a control
    	}
    
  4. Just call ShowNextTip() or ShowPrevTip().

Member Functions


Function prototype Description
void AddTip(CString strTip) Add tip-text to the CTipStatic
void SetSliderColor(COLORREF colSlider) If you use 'Slider', this 'colSlider' is wonderful effect just like 'Outlook today's tip'.
void SetSliderMode(BOOL bSlider) Use 'slider' mode on not

Ajou University C.C. 4th member.

Downloads

Download demo project - 124 Kb
Download source - 2 Kb


Comments

  • Bug

    Posted by danandu on 07/17/2007 02:57am

    "MemDC.h is not found" error appears during compilation after commenting this line, the code compiles and it works

    Reply
  • Nice.

    Posted by Legacy on 01/23/2004 12:00am

    Originally posted by: sob

    Wow.
    Great.
    Very useful.
    Did that all by yourself did you?
    Wow.
    Amazing.
    Keep up the good work!

    Admin: Please filter out these kinds of tutorials.

    Reply
  • Posted by Legacy on 07/29/2000 12:00am

    Originally posted by:

    ㄹㄹㄹㄹ

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

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Email is the most common communication vehicle used by organizations of all shapes and sizes. Among the billions of email messages sent every day are sensitive information, critical requests, and other essential business data. IT staff bear the burden of ensuring the confidentiality, integrity, and availability of the information contained within the communication. This white paper explores the email security landscape, an assessment of the threats organizations face,  and the building blocks of an effective …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds