Solved

Multicolumn CListBox

Posted on 1997-04-04
2
821 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 60
How to create frequencies of a variable from SAS dataset? 10 125
Define unique primary key 9 92
maxBlock challenge 30 129
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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