Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2005

Tip: Looking for answers? Try searching our database.

Drag n Drop URL from IE problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andreas Zita - 12 Sep 2005 10:51 GMT
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
Mona - 12 Sep 2005 12:12 GMT
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]

> Hi
>
[quoted text clipped - 12 lines]
>
> /Andreas Z
Andreas Zita - 12 Sep 2005 12:54 GMT
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
Andreas Zita - 13 Sep 2005 12:07 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.