473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How can I support the dragging and dropping of supported documents onto my form?

Hi Gang,
I would like to be able to drag and drop documents onto my application and
have them open immediately thereafter. Can somebody point me towards a KB
article or example? I could find a lot of examples pertaining to dragging
and dropping objects within a form, but nothing about dragging external
documents over a form.
Thanks in Advance,
Christian Blackburn
Nov 20 '05 #1
2 1426
"Christian Blackburn" <Christian@Damn@Sp**@Hotmail.com> schrieb
I would like to be able to drag and drop documents onto my
application and have them open immediately thereafter. Can somebody
point me towards a KB article or example? I could find a lot of
examples pertaining to dragging and dropping objects within a form,
but nothing about dragging external documents over a form.

Don't know if you've already read:

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB/vbcon/html/vbcondragdropclipboards
upport.htm

(see hints in signature)

--
Armin

- Links might be split into two lines. Concatenate them using notepad.
- Links might require to add a ".nnnn" after the "2003FEB", e.g.
"2003FEB.1033" for localized versions.
- Links starting with "ms-help" are URLs for the document explorer (<F1>).
Paste them in the URL textbox and press enter. Using internal help (menu
tools -> options -> environment -> help), display the "Web" toolbar that
contains the textbox.

Nov 20 '05 #2
Dude, it almost the same thing as dragging and dropping internat objects.
What you need to do is get the dragged object as a FileDrop:

on your DragEnter handler:
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
'this is a file
e.Effect = DragDropEffects.Copy
else
e.Effect = DargDropEffects.None
End If

on your DragDrop handler:

Dim data as Object = e.Data.GetData(DataFormats.FileDrop)
Dim fileList() as object = CType(data, object())
Dim fileName as string
For Each fileName in fileList
'do whatever you need to do with the file name
Next

There are probably some syntax errors above but you get the idea.

HTH

TJ!

"Christian Blackburn" <Christian@Damn@Sp**@Hotmail.com> wrote in message
news:eU*************@TK2MSFTNGP12.phx.gbl...
Hi Gang,
I would like to be able to drag and drop documents onto my application and
have them open immediately thereafter. Can somebody point me towards a KB
article or example? I could find a lot of examples pertaining to dragging
and dropping objects within a form, but nothing about dragging external
documents over a form.
Thanks in Advance,
Christian Blackburn

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: charliewest | last post by:
I have created a user control (ascx) in C# which accesses a database and fills a datagrid. When i attempt to drag and drop this control onto a new Web Form (aspx), my VS .NET 2003 program crashes....
12
by: code_wrong | last post by:
Hi, as the subject says How many browsers must we support? How many are there exactly? When I run this JavaScript in Firefox and IE6: function init(){ if(document.getElementById) alert("W3C...
5
by: joe | last post by:
I have an image database that I'd like to populate by dragging an image off the desktop and dropping onto a form (cut/paste would work equally as well) Any suggestions? Thanks, Joe
0
by: Fred Heida | last post by:
Hi, I try to implement dragging (and dropping) of text inside a rtf control (similar as word i guess) I have set AllowdDrop = true and setup the handlers for DragDrop, DragOver, DragEnter. is...
0
by: James Slade | last post by:
Hi there, I have a main form with a textbox on it. I have a secondary form that, when a button is clicked on the main form, pops up with a treeview. I want to be able to drag nodes onto the...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
4
by: spectecjr | last post by:
Hey folks; I've got a weird problem... whenever I try to drag and drop a toolbox item onto a form in the Window Forms editor, the control is automatically added on the first click. This gives...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.