?
Solved

WHY DOESN'T WINDOWS TREEVIEW DragOver EVENT FIRE?!?!?!

Posted on 2011-02-18
4
Medium Priority
?
497 Views
Last Modified: 2013-12-17
I have a treeview in my windows form.  

 - AllowDrop and all associated events are wired up.
 - It allows dragging/dropping of it's own tree nodes, as well as files from windows explorer.
 - 75% of the time everything works fine.  

Last year I noticed that on certain computers, dropping of files from windows explorer didn't work.  I was never able to re-produce this on my development box though, so it went unfixed for a long time.  Last week though, I noticed it happening (sometimes) on my dev box - so I've set breakpoints in the DragEnter and DragOver events in the treeview to see WHY it doesn't allow dropping of files.  The strange thing is that what I've found is that these events simply don't fire?  I can STILL drag/drop treenodes within the tree, but SOMETIMES (SPORADICALLY) it simply doesn't fire those events for files dragged from windows explorer.

One other piece of information is that I had noticed similar behavior in the past when dragging files from a different monitor.  In those cases I could simply move the windows explorer window onto the same screen as my app and then it worked as expected.  In this case, there is only one monitor in play though - so I don't think that's the cause here.  

ANY suggestions greatly appreciated!
0
Comment
Question by:kalliopi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 34927408
One possible cause for this issue is UAC (User Account Control) issues on Vista (and above).  If the UAC is turned on in Vista it prevents some kind of drag/drop operations as a "security measure".  On Win 7 it can also occur if the default UAC has been turned to a stricter mode of operation.

What operating system is being used on the machines that exhibit this problem?  Is UAC turned on for any of them?  What level of user is logged in?  etc....

Here's a recent example:
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_26723582.html
http://foxsys.blogspot.com/2009/08/windows-7-user-account-control-uac-drag.html
0
 
LVL 6

Author Comment

by:kalliopi
ID: 34927851
I bet that's exactly what's going on.  Thanks.  I am now suddenly unable to re-produce the problem.  But as soon as I am able to verify this theory, I will award points for a correct answer.  Thanks.
0
 
LVL 6

Author Comment

by:kalliopi
ID: 34980852
I have been unable to reproduce this problem since it originally occurred, but I am about 90% certain that your suggestion about it being the UAC is probably right.  Thanks.
0
 
LVL 6

Author Comment

by:kalliopi
ID: 35038140
So - WAS Finally able to re-create the problem, and unfortunately, even though it seemed like a REALLY good explanation for the behavior, it does NOT appear to be related to the UAC.  Even when I run the app as Administrator, it still ignores my drag over events when the data comes from Windows Explorer.  STILL CONFUSED!!! I guess I'll have to re-post the question though - since points have already been awarded here.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 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