List View Colum header

Posted on 2003-03-26
Medium Priority
Last Modified: 2011-09-20
Hai Experts,

  I have used a list view componenet with viewstyle 'vsReport' and showcolumheaders property 'True' in an application. I want to change the width of the column header on resizing the column header using mouse. How do I do this? Is there any event for colum header resizing? Do I need to handle any windows message for this? Please help....


Question by:pradeep_pc
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
LVL 27

Expert Comment

ID: 8216133
you have nothing else to do,
column-resizing is already implmented

meikl ;-)
LVL 12

Expert Comment

ID: 8216141
RunTime solution:
ListView1.Columns[0].Width := 128;
ListView1.Columns[1].Width := 256;

DesignTime solution:
Using ColumnEditor and set the property value Width in the Object Inspector.

I did try both methodts and they work.


Author Comment

ID: 8216317
hai esoftbg,

I want to set the coulumn width at runtime on resizing the column header using mouse.I couldn't see any event for clolumn header resizing.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 8216329
hai esoftbg,

I want to set the coulumn width at runtime on resizing the column header using mouse.I couldn't see any event for clolumn header resizing.
LVL 27

Expert Comment

ID: 8216616
what should happen on this event?

Expert Comment

ID: 8218629
Hmmm...I don't understand why you would want an event...

If this is just to prevent the user from resizing the Column too small or too large, just use the MinWidth, MaxWidth properties on the Columns property page...=)


Accepted Solution

steve_hsk earned 1000 total points
ID: 8218648
Hi Pradeep,

From what I understand you want to use OnReSizeColumn events. These don't exist by default in the original TListView component.

The only way, as I understand, to do this is to create your own component, inherited from TListview, and write these events manually.

I have included a link that does exactly this, and only this, so it would appear perfect for your solution, without being overly complicated ...


The class declaration starts as follows :-

TPBExListview = class(TListview)
    FBeginColumnResizeEvent: TLVColumnResizeEvent;
    FEndColumnResizeEvent: TLVColumnResizeEvent;
    FColumnResizeEvent: TLVColumnResizeEvent;

So these new events will potentially fulfill your requirements.

I Hope this helps,

Featured Post

Industry Leaders: 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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month9 days, 6 hours left to enroll

764 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