Vb .net drag drop to a file


















Your name or email address: Do you already have an account? No, create an account now. Yes, my password is: Forgot your password?

This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register. By continuing to use this site, you are consenting to our use of cookies. Empty End Try. As you might be able to guess I only look at the first email message if multiple are selected and let the user know that also. I have a similar need to save files, Outlook attachments, or Outlook emails to my database. I have an email that has another email attached and I need to save only the attached email that is being dragged into my application window.

The Outlook drag and drop grabs the information about what your dropping. Since it sees the. The best you could do is add a prompt that asks the user, something like:.

Answer No to add any attachment instead. YesNo, "Message itself? This way if they say no it will skip to the next else statement and do the attachment. If they click Yes it will add the email itself. Thanks so much for the prompt response! Your solution is good.

Looking around how to handle email attachments for my application and found your code very nice. The next section provides an example of dragging a different type of data and providing support for both cutting and copying. This is necessary because the AllowDrop property is not available at design time. In the MouseDown event, the code first checks to make sure that there is an image assigned to the PictureBox ; otherwise, after you moved the picture, subsequent clicks would raise an exception.

Also note that in both the DragEnter and DragDrop events the code checks to see if the CTRL key is pressed to determine whether to copy or move the picture.

Why are the values different? In the DragEnter event, the left mouse button is down, resulting in a value of 8 for the CTRL key plus 1 for the left mouse button. KeyState Property. Both examples so far have dealt with dragging between two controls on the same form; they would also work for dragging items between controls on different forms within an application.

The next example demonstrates accepting items dropped from another application — in this case, files that are dragged from Windows Explorer. Toggle navigation. Learn more. NET Ask Question. Asked 9 years, 5 months ago. Active 2 years, 2 months ago. Viewed 56k times. Is that possible? Could someone provide me with an example maybe? Improve this question. Peter Mortensen Add a comment. Active Oldest Votes.

Object, e As System.



0コメント

  • 1000 / 1000