Solved

Win32, List View and item position

Posted on 2006-11-02
4
629 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
[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
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:Jose Parrot
Jose Parrot 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:Jose Parrot
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Simple Linear Regression

691 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