tags:

views:

21

answers:

1

Hi, I have a windows forms webbrowser (Windows.Forms.WebBrowser) I want to capture the drag drop event over it.

I did not see any drag drop events on it that I can hook into ? It just has DoDragDrop()

Could you please guide me as to how to capture the drag drop event on it? I want to handle these events in a parent control that hosts it.

Thanks!

A: 

You can enable Drag Drop on the WebBrowser control via the "AllowWebBrowserDrop" property, i.e.

webBrowser1.AllowWebBrowserDrop = true;

Then you can intercept the "Navigating" event to read the URL that was dropped:

  private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
  {
     MessageBox.Show(e.Url.ToString());
  }
AaronY
Thanks for your reply Aaron, but how do I hook up the drag over event equivalent for the browser control? the navigating gets run AFTER you drop the files right? I want an event that gets fired when it is over the control...Thanks!
guest