Solved

Multicolumn CListBox

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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