Solved

Win32, List View and item position

Posted on 2006-11-02
4
627 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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…

820 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