Click here to Skip to main content
11,934,380 members (55,032 online)
Click here to Skip to main content


67 bookmarked

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

	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);

	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.


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

Carlos Souza
Software Developer
Brazil Brazil
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151126.1 | Last Updated 14 Aug 2007
Article Copyright 2007 by Carlos Souza
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid