Click here to Skip to main content
13,139,132 members (80,562 online)
Click here to Skip to main content

Stats

71.9K views
4.4K downloads
67 bookmarked
Posted 14 Aug 2007

Expandable List Control to Accept Multilines

, 14 Aug 2007
A derived CListCtrl class that expands its rows when it receives multilines
#pragma once

// CMultiLineListCtrl

class CMultiLineListCtrl : public CListCtrl
{
	DECLARE_DYNAMIC(CMultiLineListCtrl)

public:
	CMultiLineListCtrl();
	virtual ~CMultiLineListCtrl();
	void SetGridColor(COLORREF color); 
	void ShowGrid(bool show);
	void ShowMinimized(bool show);
	void CloseAll();
	BOOL SetBkColor(COLORREF cr);
	int InsertItem(const LVITEM* pItem);
	int InsertItem(int nItem,LPCTSTR lpszItem);
	int InsertItem(int nItem,LPCTSTR lpszItem,int nImage);
	BOOL SetItemText(int nItem,int nSubItem,LPCTSTR lpszText);
protected:
	DECLARE_MESSAGE_MAP()

	COLORREF colorSymbol;
	CPen dot;
	bool m_repeatEvent;
	bool m_skipTextCheck;
	bool m_grid;
	bool m_minimized;
	COLORREF m_gridColor;
	int m_lastSelected;
	int m_selected;
	
	afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnActivate(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnDblClick(NMHDR *pNMHDR, LRESULT *pResult);
	void CalcNumberOfLines(int nItem, LPCTSTR lpszText, bool insert = true);
	void OpenCloseRow(int row);
};

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.

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

Share

About the Author

Carlos Souza
Software Developer
Brazil Brazil
No Biography provided

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170915.1 | Last Updated 14 Aug 2007
Article Copyright 2007 by Carlos Souza
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid