Drag n Drop URL from IE problem

A

Andreas Zita

Hi

I have a form app which stores URL:s dragged to it from IE. The problem I
have occurs when a URL has been dragged and dropped onto the form and when
the user either moves the cursor back over the browser window (without any
clicking) or when clicking in form after the drop operation. When moving
cursor back to the browser, the browser emediately reloads the URL as if the
drag operation wasn't allready completed and now followed the cursor back to
the browser window again. Secondly, when the user has dropped the URL onto
the app form and then also clicks in the form, the drop function is
activated once more! Do I explicitly have to close or finish the dragdrop
process once the data has been dropped as expected the first time?

Thanks for any suggestions!

/Andreas Z
 
M

Mona

Hello Andreas,
How are you doing?

Regarding the issue that you have raised relating to the refreshing or the
pge in IE when the mouse moves back to the browser.

I tried replicating the scenario, and was somewhat successful. If I do
nothing in my drop event and just use e = e.empty in drop event of a text
box.
I can see what you are experiencing. To solve this I replaced the following
code:
e=e.Empty
with
e=nothing

Here is my code snippet for the drop text box:

Private Sub TextBox2_DragEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles TextBox2.DragEnter
If (e.Data.GetDataPresent(DataFormats.Text)) Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
End If
End Sub

Private Sub TextBox2_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles TextBox2.DragDrop
'TextBox2.Text = e.Data.GetData(DataFormats.Text).ToString
'e = e.Empty 'This recreates the issue
e = nothing 'Solves the issue

End Sub

I hope this helps.


Thanks
Mona
[Grapecity]
 
A

Andreas Zita

Hi Mona and thanks for your suggestion!
Unfortunately however it didn't work for me. Setting e to <nothing>, for me
<null> (c#), didn't change anything I could notice. I also doesn't need to
set e = e.Empty or e = (DragEventArgs)DragEventArgs.Empty (c#) to make the
problem appear.
I have also tried e.Data.SetData(null) without success.
Worth mentioning is also that the second time dragdrop is triggered, the
extracted URL caption is a bit different from the first time.

/Andreas Z
 
A

Andreas Zita

Have solved this issue now ... It was a error made by myself ... I had by
misstake attached duplicated databindings to a certain object in the
dragdrop method and this was somehow causing the problem ... I have no idea
how but it apparently did ... really odd ... anyhow .. solved now

/AZ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top