Add multiline to ClistBox in MFC C++

BaritoneH used Ask the Experts™
I know how to use ClistBox and AddString to add one line of string at a time.  However, is there a easy way to automatically add multiple lines to the list box if a string is embedded with "\n".


"First Line of Text \n Second Line \n  Third Line \n" in the Cstring

With MFC in C++, Is there a function that I can use to automatically parse this line into three lines and add three separate lines to the ClistBox.   Thanks.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
AndyAinscowFreelance programmer / Consultant
Not easily - the list box is designed to display single lines of text.

You would need to have an owner draw listbox
Hi BaritoneH,

here you can find a class which implements a multiline CListBox (even with optional capability to edit entries):

Hope that helps,


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial