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
Solved

List view column auto size....

Posted on 2002-04-08
4
368 Views
Last Modified: 2010-04-04
Hi guys

  I have a small problem abt the LV component. I have to change the column of a listview for different options. so i clear the columns and rewrite the columns at runtime, while doing this i set the autosize of the column to true.
but the first time it works perfect but on subsequent change of the options it dosent resize itself.

can anybody have a solution for this .....

Razal
0
Comment
Question by:razal_ka
4 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 6926579
how about Refreshing the component?
0
 

Author Comment

by:razal_ka
ID: 6930464
tried with vain .............but not use
0
 
LVL 6

Accepted Solution

by:
Stuart_Johnson earned 50 total points
ID: 6930475
This is a bodgey way of doing it, but it's the only way I've solved it:

ListView.Width := ListView.Width + 1;
ListView.Width := ListView.Width - 1;

This forces the autosize columns to resize.  Now, I'm sure there is a better way of doing it, but I haven't found it and I've been using this for ages.

Stu
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9002997
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from Stuart Johnson

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
Delphi selector screen 2 84
creating threads in delphi 1 131
tvirtualstringtree freeze when load too manny images 10 71
Dynamically Created Query 3 62
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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