Click here to Skip to main content
15,867,308 members
Articles / Desktop Programming / MFC
Article

A nice multiline ToolTipCtrl example.

Rate me:
Please Sign up or sign in to vote.
4.42/5 (24 votes)
8 Feb 2004 124.1K   3.9K   48   35
A nice multiline ToolTipCtrl example looking like the one available in Delphi.

Sample Image - ToolTipEx.jpg

Introduction

Well there is nothing much to say about this. This is a simple better looking multi-line tooltip control.

#pragma once
class CToolTipCtrlEx : public CToolTipCtrl
{
 DECLARE_DYNAMIC(CToolTipCtrlEx)
 enum Orientations
 {
  NW=1,
  NE,
  SW,
  SE,
 };
public:
 CToolTipCtrlEx();
 virtual ~CToolTipCtrlEx();
protected:
 DECLARE_MESSAGE_MAP()
 virtual void PreSubclassWindow();
private:
 afx_msg void OnPaint();
 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
 afx_msg void OnNcPaint();
public:
 COLORREF m_bkColor;//=RGB(255,255,255);
 COLORREF m_leftColor;//=RGB(255, 210, 83);
 COLORREF m_frameColor;//=RGB(155, 110, 53);
 COLORREF m_textColor;//=RGB(0,0,0);
 COLORREF m_arrowColor;//=RGB(0,0,0);
};

Just use it like a normal ToolTipCtrl control.

In the end

This is a tooltip inspired by the Delphi Flat Hint and the arrows are using the port of the Delphi drawing algorithm. This is free to use, modify it but you can't claim it. Any feedback and rating is most welcome.

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


Written By
Web Developer
Romania Romania
I have been programming for the past 6 years in VBasic, Delphi, C, C++ .
I also have extended knowledge of webdesign (HTML, CSS, JavaScript, VBScript), webprogramming (PHP, ASP, ASP.NET (C#)) and database integration (mySql, MSSQL Server).
And when I`m not programming I`m working out or working on some personal projects .
Last but not least I`m looking for a project-based job in programming or webdesign .

Comments and Discussions

 
GeneralThe Book of Knowledge Pin
Antonio Barros9-Feb-04 23:19
professionalAntonio Barros9-Feb-04 23:19 
GeneralRe: The Book of Knowledge Pin
TomKat9-Feb-04 23:40
TomKat9-Feb-04 23:40 
GeneralRe: The Book of Knowledge Pin
Gary Wheeler10-Feb-04 10:50
Gary Wheeler10-Feb-04 10:50 
GeneralRe: The Book of Knowledge Pin
TomKat11-Feb-04 1:32
TomKat11-Feb-04 1:32 
GeneralRe: The Book of Knowledge Pin
alex.barylski2-May-04 22:27
alex.barylski2-May-04 22:27 
GeneralRe: The Book of Knowledge Pin
TomKat3-May-04 0:18
TomKat3-May-04 0:18 

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

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