Solved

Win32, List View and item position

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

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

739 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