Make three colums in the listbox and populate them.

Posted on 2006-05-05
Last Modified: 2010-04-24
How do I create a list box with three columns ant populate all three colums at once???  I am using MS c++ .Net 2003
I tried creating a Clistbox and using a Cstring format to populate it but the text in each column is not alined right.
I used:
           CString txt;
           int value1, value2;

           txt.Format(%9s    %6ds    %7d ", txt1, value1,value2);

Sample output:

         J23.1            234         123
       J12.0               129          349
          J4                23          90

Question by:lcrogers
    1 Comment
    LVL 48

    Accepted Solution

    You need listview control for this. See CListView class.
    If you want to do this with list control, you need to select proportional font like Courier New in the dialog.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
    In Easy String Encryption Using CryptoAPI in C++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now