Solved

Multicolumn CListBox

Posted on 1997-04-04
2
833 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

707 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