Solved

Win32, List View and item position

Posted on 2006-11-02
4
621 Views
Last Modified: 2013-11-13
When the view style of items in a window is set to List (not Icons, Details
and etc),
some _long_ captions of the items are truncated and three dots "..."
appended to caption text.
Is there a way to increase distance between items, so long captions
will not be truncated?
Any registry tricks or programming technique?
I use Borland C++ Builder/Delphi (i.e. VCL, TListView with ViewStyle=vsList),
but workaround can be direct Win32 API method.
0
Comment
Question by:tumur
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
Dabas earned 125 total points
ID: 17857014
Hi tumur,
Try changing to Details style, enlarge the columns, then change back to list style.


Dabas
0
 
LVL 18

Assisted Solution

by:JoseParrot
JoseParrot earned 125 total points
ID: 17858634
Hi,

The user can interactively change the column width and the new width will remain until the application is closed.

To do it programmatictly:
  TListColumn *pColumn;
// when adding a new column
  pColumn = ListView1->Columns->Add();
  pColumn->Caption = "Column 1";
  etc...
// define Width as -1, so the column witdh will be adjusted to string length
  pColumn->Width= -1;

if you need, can set also the MaxWidth property.

Jose
0
 
LVL 18

Expert Comment

by:JoseParrot
ID: 17878171
Hi,

Didn't work?

Jose
0
 

Author Comment

by:tumur
ID: 17880007
Thank you, Dabas & JoseParrot!
Though I did not do exactly as you recommended, the principle of the workaround
I have found thank for your ideas, is simple: switch to vsReport mode, change the
1st columns width if it's necessary and switch back to vsList. Because my ListView
object is designed to work only in vsList mode, it does not have columns. So after
populating items and showing the form, I do only this:
MyListView->ViewStyle = vsReport;
MyListView->ViewStyle = vsList;
and nothing more. The captions are not truncated more!
Thank you again!

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scoresClump  challenge 31 108
Replace a tag with sed 2 43
countX 22 70
wordappend challenge 8 86
This article will show, step by step, how to integrate R code into a R Sweave document
This is about my first experience with programming Arduino.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 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