Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

A nice multiline ToolTipCtrl example.

0.00/5 (No votes)
8 Feb 2004 2  
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