• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

List View Colum header

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
pradeep_pc
Asked:
pradeep_pc
1 Solution
 
kretzschmarCommented:
you have nothing else to do,
column-resizing is already implmented

meikl ;-)
0
 
esoftbgCommented:
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
 
pradeep_pcAuthor Commented:
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
Technology Partners: 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!

 
pradeep_pcAuthor Commented:
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
 
kretzschmarCommented:
what should happen on this event?
0
 
raidosCommented:
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
 
steve_hskCommented:
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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now