Looks like a bug to me (or I'm missing some property that needs to be set).
I checked the code with reflector and the following is basically what
happens (as far as I can tell anyway) :
When getting a HDN_BEGINTRACK notification a flag is set to true.
When getting a HDN_ITEMCHANGING notification they check if this flag is true
and if so fires the ColumnWidthChanging event
When getting a HDN_ENDTRACK notification they flag is set back to false.
Problem is that the notifications (verified with Spy++) come in the order
HDN_BEGINTRACK -> HDN_ENDTRACK -> HDN_ITEMCHANGING, meaning the flag is
never true!?!
This code might help you wok around the problem (it returns IntPtr(1) to
prevent the column from being resized):
http://groups.google.com/group/microsoft.public.dotnet.framework.windowsforms.co
ntrols/msg/69dd7cedfbdea8e5?hl=sv
/claes
> Can anyone think of any reason why ListView's ColumnWidthChanging event
> (.NET 2.0) would NOT fire? I have a handler set up for this but I
> never hit the break point. The ColumnWidthChanged event fires just
> fine.
>
> Roy
roybrew@att.net - 21 Sep 2006 16:58 GMT
Yes, I think I had seen this posting before in my research. It just
seemed odd that the event never fires.
Thanks.
roy
> Looks like a bug to me (or I'm missing some property that needs to be set).
> I checked the code with reflector and the following is basically what
[quoted text clipped - 21 lines]
> >
> > Roy