Solved

ListBox tab settings - mine don't work

Posted on 2006-11-11
2
714 Views
Last Modified: 2013-11-20
I'm trying to set tabs in a list box. The box works - my fields are being displayed in the box, but the tab setting apears to have no effect. I have tried settings from 1 to 200 and nothing happens. Ideas? Thanks.

ComplMessage.Format("%d %s %s %.4f %.4f %.4f %d",
Subs[i].ComboLine,
Subs[i].ContractName,
Subs[i].ContractDate,
Subs[i].Last,
Subs[i].Bid,
Subs[i].Offer,
Subs[i].Volume);

int tabber = 10; <----I have varied this from 1 to 200 and nothing happens
int tabs[7];
tabs[0] = tabber;
tabs[1] = tabber;
tabs[2] = tabber;
tabs[3] = tabber;
tabs[4] = tabber;
tabs[5] = tabber;
tabs[6] = tabber;
pListBox->SetTabStops(7, tabs); <---- this doesn't work
pListBox->AddString(ComplMessage); <----this works
0
Comment
Question by:Elliot123
2 Comments
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 250 total points
ID: 17924045
Your listbox must have   LBS_USETABSTOPS in order to use CListBox::SetTabStops().. you may mention this style while creating listbox or with ModifyStyle()..

e.g.

pListBox->ModifyStyle(0, LBS_USETABSTOPS, 0);  // Add style LBS_USETABSTOPS

pListBox->SetTabStops(7, tabs);
pListBox->AddString(ComplMessage);

-MAHESH
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 88
Error on moodle after upgrade 3 106
wait notify demo infinite loop 3 81
NotAlone Challenge 20 72
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
This video discusses moving either the default database or any database to a new volume.

757 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

18 Experts available now in Live!

Get 1:1 Help Now