Solved

Multicolumn CListBox

Posted on 1997-04-04
2
826 Views
Last Modified: 2013-11-20
Hello,

I want create a CListBox with 4 columns and I want to use the proportional font "MS Sans Serif".

I'm a little bit confused how to manage this.

I know of LBS_MULTICOLUMN and SetColumnWidth, LBS_USETABSTOPS and SetTabSTops but I need
an example to create the ListBox and fill with data.

I give 200 points for you and hope to get a GOOD example
that is running !!!

Thanks for any help.
0
Comment
Question by:muma0016
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
rhgaracci earned 200 total points
ID: 1300841
Multicolumn listboxes have fixed width columns, ie all columns are the same width.  Using tabs, the widths can be variable.  Which are you interested in doing?  I can help you with the details.
0
 
LVL 1

Expert Comment

by:rhgaracci
ID: 1300843
To do the tabbed listbox, set the "Use Tabstops" property for the listbox in the dialog editor properties box. then add this code to the OnInitDialog():

// array of tab stops in dialog units
//
int iTabs[] = {40, 80, 120};

// set the tab stops
//
m_listBox.SetTabStops(sizeof(iTabs)/sizeof(int), iTabs);

// add strings, tab separated
//
m_listBox.AddString("Column1\tColumn2\tColumn3\tColumn4");
m_listBox.AddString("X\tX\tX\tX");

Voila, columns!!!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maven archtype selection in eclipse 1 57
java ^ examples 8 69
pre4 challenge 19 103
Line meaning 9 87
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

792 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