Solved

How can I change the height of a listview header,part3

Posted on 2010-09-16
2
266 Views
Last Modified: 2012-05-10
Hi,

I have asked a couple of question regarding how to change the height
of a listview header. I have received a lot of good solution, but they all
have one minor problem, when the user resizes the columns of the list-
view or resizes the form itself, then the size of the header goes back
to its origal size. I have searched and tried all week to solve this prob-
blem, and I was about to give up. Until I saw  the component Header-
Control on the componentpalet. So I have tried the solution
from jimyX in the question:

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_26469385.html

Only I use a HeaderControl and a Listview instead of 2 listview.
Now what I have to do is tell the HeaderControl when the user resizes
then the columns of the listview has to resize with it.
Who can help me to solve my last problem regarding the Listview-component.

Greetings, Peter Kiers


Example.jpg
0
Comment
Question by:peterkiers
[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 Comments
 
LVL 24

Accepted Solution

by:
jimyX earned 500 total points
ID: 33694481
Try this
procedure TForm1.HeaderControl1MouseUp(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
 index : integer;
begin
  with ListView1 do
  for Index := 0 to (Columns.Count - 1) do
    ListView1.Column[Index].Width := HeaderControl1.Sections.Items[Index].Width;
end;

Open in new window

0
 
LVL 1

Author Comment

by:peterkiers
ID: 33694825
PERFECT. 500 points are comming to you....

Greetings,

Peter Kiers
0

Featured Post

Independent Software Vendors: 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 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