473,662 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drag Drop getting file type or ID

Hi i want to be able to determine what type of file is being dragged on
to my form, ive got this:

private void Form1_DragDrop( object sender, DragEventArgs e)
{
//tell me the file type please

}
private void Form1_DragEnter (object sender, DragEventArgs e)
{
e.Effect = DragDropEffects .All;

}

not much i know but its a start

i thought id get it through e.data.getdata but i cant figure it out.

i assumes different file types have some sort of different ID, i want
to check the ID of a certain file type, and capture those types of
files being dragged on to my form.

what are the different types? i understand theres a few issues around
the mail type from outlook?

Feb 1 '06 #1
2 2569
WRH

Hello

Look at DataFormats, eg DataFormats.Fil eDrop etc
eg

if(e.Data.GetDa taPresent(DataF ormats.xxx) is what I want
then
do stuff..
Ames111" <an*********@4p rojects.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Hi i want to be able to determine what type of file is being dragged on
to my form, ive got this:

private void Form1_DragDrop( object sender, DragEventArgs e)
{
//tell me the file type please
}
private void Form1_DragEnter (object sender, DragEventArgs e)
{
e.Effect = DragDropEffects .All;

}

not much i know but its a start

i thought id get it through e.data.getdata but i cant figure it out.

i assumes different file types have some sort of different ID, i want
to check the ID of a certain file type, and capture those types of
files being dragged on to my form.

what are the different types? i understand theres a few issues around
the mail type from outlook?

Feb 1 '06 #2
Ames111,

There are no file type IDs or whatsoever. When you drag files you drag
strings that contain files' full names. You need to recognize your files by
their extensions (which can't be 100% error proof) or open the file and read
some signature in the beginning.
--

Stoitcho Goutsev (100)

"Ames111" <an*********@4p rojects.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Hi i want to be able to determine what type of file is being dragged on
to my form, ive got this:

private void Form1_DragDrop( object sender, DragEventArgs e)
{
//tell me the file type please

}
private void Form1_DragEnter (object sender, DragEventArgs e)
{
e.Effect = DragDropEffects .All;

}

not much i know but its a start

i thought id get it through e.data.getdata but i cant figure it out.

i assumes different file types have some sort of different ID, i want
to check the ID of a certain file type, and capture those types of
files being dragged on to my form.

what are the different types? i understand theres a few issues around
the mail type from outlook?

Feb 1 '06 #3

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

Similar topics

1
7624
by: Karsten Schramm | last post by:
Hi, if I drag an Outlook.MailItem to a Windows-Explorer window a <subject>.msg file will be created. Now I try to drag & drop a mail item to my own WinForm app. Unfortunately it doesn't work. In the "drop event" are eight DataFormats (e.Data.GetFormats()) but the important one (imho) "FileContents" is "Nothing"/"null".
5
4955
by: Clyde | last post by:
I am trying to implement the user feedback provided by Windows Explorer when draggng a filename from one place to another. I have the drag and drop action worked out but have had no luck in finding how to capture the piece of the screen into a bitmap to simulate the movement. I know this could be done with the Windows API but can't find any way to do it with .Net functions. Any help is appreciated.
6
3545
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product where the user can run on firefox/mozilla, what would be a good approach. 1. Should I overwrite the javascript code drag-and-drop to make it more browser independent. If I want to go this route, can anybody provide me a
6
4949
by: James Allen Bressem | last post by:
I was searching through the MSDN documentation trying to figure out how to do drag n drop and I found a sample program. The sample program did all sorts of fancy junk like dynamically create it's user controls etc. (pomp - is it really necessary to be so gaudy when trying to explain a simple point?) So, realizing the state of the economy and the period of history in which I was so unfortunately born, I spent the next 3 or so hours weeding...
5
10146
by: Brian Henry | last post by:
I haven't worked much with drag/drop but I am trying to make a form that accepts files to drug onto it from explorer and droped and have the form know the full path and file name of the files dropped onto it.. does anyone have any examples of this? thanks
17
31635
by: Romulo NF | last post by:
I´ve seen some people around the web wondering about a code to reorder table columns using the mouse (drag and drop). Since i had already made one script to reorder table lines (TR´s) i decided to start working in one to reorder the columns. Im sharing this code with you all now. If anyone find any issue needing improvements just email-me and i will try to fix. The implementation is very easy, only change the ID of the table in the tabelaDrag...
0
8444
by: Romulo NF | last post by:
I´ve recently posted a script to move columns from a table using drag and drop javascript. Recently i´ve received a message of a user of this communty showing interest in the script to move lines instead of columns. This post will present the script for you guys. file: moverows.css table {border-collapse:collapse; cursor:pointer} td {width:30px; padding:5px; text-align:center; font:bold 14px verdana; color:#000; border:1px solid #000}...
1
4807
by: Thi | last post by:
Hi, I am trying to develop an application that allows the users to drag a few file(s) from a zip archive to a destination. My question is, how do i determine where the drop destination is because i need to do some validation checking before extracting the files from the zip archive (e.g. validate archive password). Any help or some sample codes would be very much appreciated.
1
2890
by: Steve Bottoms | last post by:
Hi, all! Using VB .Net 2k5 under Vista Business... I'm trying to put together a very basic drag-and-drop for file copying, and can't seem to get DragDrop events (Form, PictureBox, TextBox, etc) to fire at all, and DragEnter only fires if the drag operation STARTS on the form (kinda defeating the purpose of a drag-and-drop file copier). Is there some trick to getting it to work? I've tried several different samples from MSDN and this...
0
8345
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
8768
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
8547
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
7368
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...
0
5655
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
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
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
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.