?
Solved

List View Colum header

Posted on 2003-03-26
7
Medium Priority
?
226 Views
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....

regards

Pradeep
0
Comment
Question by:pradeep_pc
[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
7 Comments
 
LVL 27

Expert Comment

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

meikl ;-)
0
 
LVL 12

Expert Comment

by:esoftbg
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.

Regards,
esoftbg
0
 

Author Comment

by:pradeep_pc
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.
0
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

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

Expert Comment

by:kretzschmar
ID: 8216616
what should happen on this event?
0
 
LVL 3

Expert Comment

by:raidos
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...=)

Regards
//raidos
0
 
LVL 2

Accepted Solution

by:
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 ...

http://www.swissdelphicenter.com/en/showcode.php?id=1264

The class declaration starts as follows :-

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

So these new events will potentially fulfill your requirements.

I Hope this helps,
STeve
0

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