Solved

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

Posted on 2011-02-18
4
484 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
  • 3
4 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

14 Experts available now in Live!

Get 1:1 Help Now