I have my form set up to be able to drop files into a textbox, and also drag the files out of the textbox, thus clearing the textbox. The kicker is that the drag out of the textbox has to be dropped on the form. If I try to drag it outside the form, then it crashes. I would like for the drag and drop to ignore when the mouse is moved outside of the form. Any ideas? Here's the error I get when I drag the file out of the textbox and out of the form:
Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC))
You can keep the cursor inside of the form. Cursor.Clip
MouseDown event:
Cursor.Clip = Me.RectangleToScreen(Me.ClientRectangle)
MouseUp Event:
Cursor.Clip = Nothing
User contributions licensed under CC BY-SA 3.0