Click here to Skip to main content
15,895,538 members
Articles / Desktop Programming / MFC

CTreeCtrl\CListCtrl\CListBox With ToolTip Based On the Item Data

Rate me:
Please Sign up or sign in to vote.
4.22/5 (16 votes)
24 Jan 20023 min read 200.9K   5.3K   32  
A CTreeCtrl derived class providing tooltips based on item data
// TTreeCtrlDemoDlg.h : header file
//

#if !defined(AFX_TTREECTRLDEMODLG_H__6FA6B899_3CE1_4237_82B9_AD2908D797D9__INCLUDED_)
#define AFX_TTREECTRLDEMODLG_H__6FA6B899_3CE1_4237_82B9_AD2908D797D9__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "TreeCtrlCh.h"


/////////////////////////////////////////////////////////////////////////////
// CTTreeCtrlDemoDlg dialog
class TTipItemData:public ItemDataABSTRACT
{
public:

	TTipItemData();
	CString strTool;
	POSITION pos;
	CString GetToolTipString();
};



class CTTreeCtrlDemoDlg : public CDialog
{
// Construction
public:
	CTTreeCtrlDemoDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CTTreeCtrlDemoDlg)
	enum { IDD = IDD_TTREECTRLDEMO_DIALOG };
	CTreeCtrlCh	m_Tree;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTTreeCtrlDemoDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CTTreeCtrlDemoDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TTREECTRLDEMODLG_H__6FA6B899_3CE1_4237_82B9_AD2908D797D9__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Web Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions