Solved

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

Posted on 2010-09-16
2
262 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
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…

912 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now