Click here to Skip to main content
11,491,459 members (71,214 online)
Click here to Skip to main content


, 11 Nov 2004 35.2K 1.6K 35
Rate this:
Please Sign up or sign in to vote.
Implements a Tooltip control like that displayed with the Intellisense technology.

Sample Image of the demo ParamTooltip


This article demonstrates creating a class to show tooltips for methods and its parameters, like Intellisense technology.

Using the class

Using the class is easy. You only have to instantiate an object, create the control and add information about the methods and its parameters, and then show it in any screen position.

Create a ParamTooltipCtrl in your application

Include ParamTooltipCtrl.h in the source file where you want to use the CParamTooltipCtrl control:

#include "ParamTooltipCtrl.h"

Create a member variable for the control:

CParamTooltipCtrl m_wndTT;

Create the control and initialize it with the names of methods and their parameters:


CString sMethod;
vector<CString> setParams;

sMethod = "int DrawText";
setParams.push_back(CString("const CString &str"));
setParams.push_back(CString("LPRECT lpRect"));
setParams.push_back(CString("UINT nFormat"));
m_wndTT.AddMethod(sMethod, setParams);

setParams.push_back(CString("LPCTSTR lpszString"));
setParams.push_back(CString("int nCount"));
setParams.push_back(CString("LPRECT lpRect"));
setParams.push_back(CString("UINT nFormat"));
m_wndTT.AddMethod(sMethod, setParams);

Show the ParamTooltipCtrl control in the screen

When you want to show the control, call the methods SetCurMethod and SetCurParam to set the method and parameter you want to emphasize, and then call the method ShowTooltip:


To hide the control, call the CWnd::ShowWindow method:


Iterate between methods and parameters

To iterate between the previous and next methods, and previous and next parameters, use the ShowPrevMethod, ShowNextMethod, ShowPrevParam and ShowNextParam methods:

void CParamToolTipView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
    switch( nChar ) {
        case VK_UP:
        case VK_DOWN:
        case VK_LEFT:
        case VK_RIGHT:

    CView::OnKeyDown(nChar, nRepCnt, nFlags);

Points of Interest

The method CParamTooltipCtrl::Draw draws the bitmaps creating it in memory, so you don't have to load it from resources.


Version 1.0 - Wed, 10 Nov of 2004.


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


About the Author

Software Developer Dreaming With Objects S.L.
Spain Spain
No Biography provided

Comments and Discussions

GeneralDestroyWindow Pin
Roger6519-Nov-04 5:07
memberRoger6519-Nov-04 5:07 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150520.1 | Last Updated 12 Nov 2004
Article Copyright 2004 by joseangelmt
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid