473,699 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drap Drop Question

Does anyone have some sample code that would show me how to drag and
..doc or exe file to a drop target and then extract the file path on
drop?

Nov 21 '05 #1
2 1374
Here is something I did which places dropped items in a CheckListBox. The
code is more or less a copy from a webpage (don't remember were from).

Private Sub Form1_DragEnter (ByVal sender As Object, ByVal e As
System.Windows. Forms.DragEvent Args) Handles MyBase.DragEnte r
If e.Data.GetDataP resent(DataForm ats.FileDrop) Then
e.Effect = DragDropEffects .Copy
End If
End Sub

Private Sub Form1_DragDrop( ByVal sender As Object, ByVal e As
System.Windows. Forms.DragEvent Args) Handles MyBase.DragDrop
If e.Data.GetDataP resent(DataForm ats.FileDrop) Then
Dim draggedFiles As String() =
CType(e.Data.Ge tData(DataForma ts.FileDrop), String())
For Each strFileName As String In draggedFiles
With ListBox1
.Items.Add(strF ileName)
.SetSelected(.I tems.Count - 1, True)
.SetItemChecked (.SelectedIndex , True)
End With
Next
Me.ActiveContro l = ListBox1
End If
End Sub

Hope this helps you.

"pmclinn" <pe***@mclinn.c om> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Does anyone have some sample code that would show me how to drag and
.doc or exe file to a drop target and then extract the file path on
drop?

Nov 21 '05 #2
"pmclinn" <pe***@mclinn.c om> schrieb:
Does anyone have some sample code that would show me how to drag and
.doc or exe file to a drop target and then extract the file path on
drop?


See:

<URL:http://www.google.de/groups?selm=Oc8 PBhAfDHA.1212%4 0TK2MSFTNGP12.p hx.gbl>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

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

Similar topics

2
11053
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic SFSB and, from there, to the database. On the front end, all cells appear as text fields. However, for certain cells, when the user clicks on the cell, the text field turns into a drop-down field (i.e. Select object), defaulting to the value...
4
6300
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by the choice from the drop down box. Something like: <form name="populatefrm" id="contactfrm" method="post"
1
3727
by: Torre Quinn | last post by:
Does anyone have any good sites or resources dealing with adding drag and drop functionality to a set of controls on a form? I'd like to try to get several examples of varied applications of drag and drop being used on different types of controls. My current task is this. I have a treeview control and a data grid control. The data grid has two fields, 'value' and 'name'. I want to be able to drag nodes from the tree view and drop them...
13
5249
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data structures? Thanks for any hints, Leszek Taratuta
8
10121
by: benkial | last post by:
I am writing a small GUI tool in C#, and I want to experiment some fancy trick as follows: when the user click on a "OK" button, the code will initiate a "Drag and Drop" operation in the GUI itself to itself (i.e. drag some fake object and drop to the tool itself). I am new to .Net programming, but from my reading can I achieve this using SendMessage() or PostMessage() to force a "Drag and Drop" operation? Thanks in advance,
0
1031
by: shanmuganathan82 | last post by:
i need drag and drop in table . in database get the value display lablel in table place the value using asp.net with c# and java script advance thanks by shanmuganathan
5
13782
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with drag&drop on the same page (which was not possible). Now i´ve a new concept of the script, more object oriented. I´ve also commented the whole code so you guys can easier understand it engine. What exactly we need when trying to make a column drag &...
1
1252
by: selvi166 | last post by:
hi, i am using visual studio 2005. while designing the form in asp.net 2.0 the drap and drop of the control is not working as like vb. i know there is two mode which allows drap and drop and another one not that. but i dont know whats the property anddont know how to change that the page looks without dots. i am aligning the textbox by using the enter and space key. please reply me as this is very urgent for me.
1
2957
by: student2008 | last post by:
Sorry about the title its a tricky one. I have a form which allows me to add a question and answers into a mysql database via a combination of, if a certain option is chosen and the reset button is pressed then a text box appears to enter a new question or answer or both. the newly entered data is then inserted into mysql. The newly entered data is then requested by mysql_fetch_array() to be displayed as options in the drop down list. If...
0
8620
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9180
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9038
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8920
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
8887
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
5877
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
4633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3060
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
3
2012
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.