Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / September 2006

Tip: Looking for answers? Try searching our database.

ListView ColumnWidthChanging event not firing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
roybrew@att.net - 20 Sep 2006 19:39 GMT
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
Claes Bergefall - 21 Sep 2006 16:52 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.