|
-
Jun 28th, 2008, 04:40 AM
#1
Re: [2.0] Drag and Drop from Internet Explorer
Call GetDataFormats to determine what formats the data being dropped is available in. You can then get the data in the most appropriate of the available formats and process it accordingly.
-
Jun 28th, 2008, 02:31 PM
#2
Thread Starter
Lively Member
Re: [2.0] Drag and Drop from Internet Explorer
 Originally Posted by jmcilhinney
Call GetDataFormats to determine what formats the data being dropped is available in. You can then get the data in the most appropriate of the available formats and process it accordingly.
I have also tried that. Here is the code I tried using the GetFormats method:
Code:
foreach (string s in e.Data.GetFormats())
{
if (s.Contains("UniformResourceLocator"))
{
e.Effect = DragDropEffects.Copy;
break;
}
}
The e.Effect = DragDropEffects.Copy line does triggers and if I put a breakline on the "break" keyword, and check the value of e.Effect, it is set to Copy. The problem is the cursor never does change to the copy cursor, and the DragDrop method never fires properly. I even went to so far as to just do this:
Code:
if(true)
{
e.Effect = DragDropEffects.Copy;
}
and the cursor still does not change! I don't even check the format, I just say change the cursor, and it doesn't work from IE. Anything else I drag onto the window works, just not any link from IE.
I thought maybe it was a security issue, since I'm running thin on ideas. In the IE security settings, I found an option called "Drag and drop or copy and paste files" but it is enabled. Nothing else in there seems to relate to anything I am doing though. Just for sh*ts and giggles, I turned my security settings as low as they would go in IE7 for the internet zone and it still did not work.
I just now found out that if I highlight regular text on a webpage in IE, and drag that to my window, it will trigger and drop the text properly, but that's useless, since I only want to allow people to drop links. I will have to check for a protocol in the string to make sure it's a valid URL.
So any other ideas would be most appreciated. Maybe I am just missing some simple property...
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|