Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

12 Experts available now in Live!

Get 1:1 Help Now