Board index » delphi » TListView's columns VS THeaderControl's sections

TListView's columns VS THeaderControl's sections

Hi,

    I'd like to know if I should "create" another component quite similar to
the the TListView with the THeaderControl's onSectionResize event?  or is
there a way to "catch" that event with the TListView?

    Mainly I want to either
    1- Disable any column resizing (just like VB allows us to (ahem...
sorry))
    or
    2- Chech is a column's width is set to 0 (by user), which will uncheck
an item in my PopupMenu of the TListView.  Basically, it's nothing but a
menu which displays selected columns in the TListView... of course,
ViewStyle is set to vsReport.

    Is that clear enough or should I post something in b.p.attachements ?

    Thanks in advance,

    Philppe

 

Re:TListView's columns VS THeaderControl's sections


Quote
In article <39874d9b_1@dnews>, Philippe Laforge wrote:
>     I'd like to know if I should "create" another component quite similar to
> the the TListView with the THeaderControl's onSectionResize event?  or is
> there a way to "catch" that event with the TListView?

There is, with a bit of work. Derive a new component from TListview and add a
handler for the WM_NOTIFY message. The control will receive quite a few of
these messages and not all are from the header control, so you need to filter
and look for HDN_ITEMChanging notifications from the header. These you need to
filter further for those that indicate a change of item width. Anything else
you pass on to the inherited handler.

The HDN_ITEMChanging notification comes in before the change has taken effect
and you can block it by returning msg.result := 1 instead of msg.result := 0;

See win32.hlp for details on the notification and the item information format.
You may want to look at TCustomHeadercontrol.CNNotify and
TCustomListview.WMNotify in ComCtrls.pas to see the mechanics of processing
such a notification.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Re:TListView's columns VS THeaderControl's sections


Dear Mister Below,

    THANK GOD I received an answer from you.  I mean... I feel like "touched
by an angel".  Make no mistake, I'm not "leeching" but DAMN... do you
realize how lucky am I?  Anyway, thank you very much for your time and I'm
sure everyone in the borland.delphi newsgroups thinks the same about you and
the whole TeamB guys.  I really wish one day I'll be "that damn good" too.

    As for the component, I though I only had to add an "onColumnResize"
event, but you've just told me how to.  Thank you very much.

    Blessed Philippe

"Peter Below (TeamB)" <100113.1...@compuXXserve.com> wrote in message

Re:TListView's columns VS THeaderControl's sections


Quote
>     I feel like "touched by an angel".
>     Blessed Philippe

Well, of all the TeamB guys I have met,  Peter Below is probably
a close as your going to get to an angel...

Joe

Re:TListView's columns VS THeaderControl's sections


Quote
"Joe C. Hecht" wrote:

> >     I feel like "touched by an angel".
> >     Blessed Philippe

> Well, of all the TeamB guys I have met,  Peter Below is probably
> a close as your going to get to an angel...

I live the life of a monk, does that count? <g>

Quote
> Joe

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
Have you ever met a lady screaming angst potential?
Have you ever dreamed of romance no matter how experimental?
Have you ever felt an alien drifting back into your hometown?
Did you think you were buying safety when you bought that piece of ground?
             (Fish)

Re:TListView's columns VS THeaderControl's sections


"Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
news:3988E416.8F8CE5@onramp.net...

Quote

> I live the life of a monk, does that count? <g>

Only in Tibet, not in the Americas..... <g>

Woody

Other Threads