Solved

TreeView screwed up?

Posted on 2002-07-05
10
634 Views
Last Modified: 2006-11-17
Hy
I put on a form a TreeView
on the TreeView MouseUp event, I put a Console.WriteLine("m up");

The mouseUp events seems to come up at the wrong times.
- If I click on a node, the mouseUp comes imediatly after i move the mouse (like a mouseMove).
- If I click on blank space, not on any node, the mouseUp events comes when I press the mouse button(like a mouseDown).

Could someone verify this? Is the treeview.net screwed up?
0
Comment
Question by:Azmodan
10 Comments
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
I am unable to reproduce this.  The MouseUp event fires each time I press and release the left mouse button anywhere on the treeview.
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
Never mind...I am able to see this problem now.
0
 

Author Comment

by:Azmodan
Comment Utility
not just press and release
press, move and release


so..same behaviour at your place... :(
this treeview seems worse than the one in VB6
0
 

Author Comment

by:Azmodan
Comment Utility
it there a way to hook in c#?
hook.. i mean to get the windowproc for a control's handle and watch for windows system messages?
0
 

Author Comment

by:Azmodan
Comment Utility
(i wrote to MS and thay responded that "This is a known problem with the TreeView control in version 1.0 of the .NET Framework.")

question remains.. how can I hook for windows messages? (to look for WM_PAINT or WM_LBUTTONUP)
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
With regards to VB, sublcassing/hooking can be accomplished the same as it is in previous versions using Windows API.  If you just want to translate that code over to C#, I can point you to a link.  I'm not sure if .NET provides any new, simpler method for performing this task.
0
 

Author Comment

by:Azmodan
Comment Utility
a..yes, it does. :) found it in the meantime :)

in every control there is a protected method WndProc that is the actual WindowProc for that control. So this method is called for each and every message the control receives.
U just need to inherit the control and play with the messages.
This way u can override the MouseUp event. And call it when u find the WM_LBUTTONUP event.(didn't do it yet, but it shouldn't be very hard).

The problem still remains, the Tree is screwed up and MS admited this.
0
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
Sounds like something fun to play with, thanks for the info.
0
 
LVL 96

Expert Comment

by:Bob Learned
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ/Refund

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0
 

Accepted Solution

by:
SerCouWisMOD earned 0 total points
Comment Utility
Question was closed per the recommendation

SerCouWisMOD
Community Support Moderator
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now