5,696,038 members and growing! (13,325 online)
Email Password   helpLost your password?
Desktop Development » Miscellaneous » Tooltips     Intermediate

VB style tool tip control similar to IntelliSense ToolTip

By Alex Hazanov

Tool tip control similar to Visual Basic IntelliSense tool tip
VC6, C++Windows, Win2K, WinXP, Win2003, MFC, VS6, Visual Studio, Dev

Posted: 16 Jul 2003
Updated: 16 Jul 2003
Views: 38,222
Bookmarked: 16 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
6 votes for this Article.
Popularity: 2.79 Rating: 3.58 out of 5
1 vote, 16.7%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
1 vote, 16.7%
4
4 votes, 66.7%
5

Sample Image - intellitip.jpg

Introduction

This is a CDialog derived window, which resembles the tool tip that pop-ups with function parameters in Visual Studio IDE. The control allows to display a function definition with it's parameters and mark the current parameter in bold font.

Usage

  1. Add a dialog resource to your project. Make sure to set the following for this dialog:
    Style = popup. 
    Border = None.
    No TitleBar
  2. Add the dialog as a member to your application's main window.
  3. Call create for the dialog while passing pointer to the window that the tool tip belongs to: m_intelliToolTip.Create(pParentWnd).
  4. Add a function definition:
    BOOL CIntelliTipDemoDlg::OnInitDialog()
    {
     CDialog::OnInitDialog();
    
     // Set the icon for this dialog.  The framework does this automatically
    
     //  when the application's main window is not a dialog
    
     SetIcon(m_hIcon, TRUE);   // Set big icon
    
     SetIcon(m_hIcon, FALSE);  // Set small icon
    
     
     // TODO: Add extra initialization here
    
     m_tip.Create(this);
     CStringArray params;
     params.Add("Param 1");
     params.Add("Param 2");
     params.Add("Param 3");
     params.Add("Param 4");
     params.Add("Param 5");
     m_tip.SetFunction("SomeFunction",params);
     m_tip.SetCurParam(3);
     return TRUE;  // return TRUE  unless you set the focus to a control
    
    }

When you need to show the tool tip, call CIntelliTip::Show() or CIntelliTip::Hide() to hide it. To set the position, call CIntelliTip::SetCursorPoint(cursorPoint). Example:

void CIntelliTipDemoDlg::OnButton1() 
{
 // TODO: Add your control notification handler code here

 CPoint pt;
 GetCursorPos(&pt);
 ScreenToClient(&pt);
 m_tip.SetCursorPoint(pt);
 m_tip.Show();
}

License

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

Alex Hazanov



Occupation: Software Developer (Senior)
Company: RDV Systems
Location: Israel Israel

Other popular Miscellaneous articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 4 of 4 (Total in Forum: 4) (Refresh)FirstPrevNext
GeneralThanks,but i have a problemmemberLancelot Yuan17:57 14 Jul '05  
GeneralRe: Thanks,but i have a problemmemberAlex Hazanov11:50 16 Jul '05  
GeneralVery Nicememberspaceseel17:52 29 May '05  
GeneralThankyou!!!memberAdrian Gibbons3:02 17 Jul '03  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 16 Jul 2003
Editor: Smitha Vijayan
Copyright 2003 by Alex Hazanov
Everything else Copyright © CodeProject, 1999-2008
Web19 | Advertise on the Code Project