473,779 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1446
"Christian Blackburn" <Christian@Damn @Sp**@Hotmail.c om> 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.2003 FEB/vbcon/html/vbcondragdropcl ipboards
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.10 33" 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.GetDataP resent(DataForm ats.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.Fil eDrop)
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.c om> wrote in message
news:eU******** *****@TK2MSFTNG P12.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
1393
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. I am forced to programmatically reference the user control. Can anyone guess if this is a problem w/ my software (VS.NET 2003) or is it not posssible to drag and drop "complex" user controls?
12
1722
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 DOM Supported"); else if(document.all)
5
1792
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
1324
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 there anything else i need to do ? becuase if i now select some text in the control and start dragging this, the very first time i see the 'no entry' sign (none of my handlers getting
0
1010
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 main form so that I can put the text of the node into the textbox. However, I can get the main form to 'see' the dragged data by setting it's allowdrop to true, but if i then set it to false and set the textbox's allowdrop to true, it can't drop. ...
14
4863
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 can be done using the designer but I intentionally don't want to use that. The one reason is that you cannot change the code generated by the designer. The other could be that you have more free hand and control to design your GUI. 2....
4
1516
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 me very little control over where it ends up, and as you can imagine, is somewhat inconvenient. Anyone know a fix for this? My work system doesn't do this.
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9930
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.