471,603 Members | 1,993 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 2447
WRH

Hello

Look at DataFormats, eg DataFormats.FileDrop etc
eg

if(e.Data.GetDataPresent(DataFormats.xxx) is what I want
then
do stuff..
Ames111" <an*********@4projects.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.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*********@4projects.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Clyde | last post: by
6 posts views Thread by jojobar | last post: by
6 posts views Thread by James Allen Bressem | last post: by
5 posts views Thread by Brian Henry | last post: by
1 post views Thread by Steve Bottoms | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by

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.