Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

792 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