You don't need remoting. You need to handle the DragEnter and DragDrop event
from the control and decide whether the clipboard contains a format of data
you can handle.
In DragEnter, check the clipboard data for formats such as bitmaps or paths
to image files. if the test is positive then allow the drop. When the drop
happens use the data in whatever way your application needs.
For example, this code enables file dropping...
protected override void OnDragEnter(DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.Text))
{
string path =(string) e.Data.GetData("Text");
if(File.Exists(path))
{
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect=DragDropEffects.None;
}
}
else
{
e.Effect = DragDropEffects.None;
}
base.OnDragEnter(e);
}
This should get you started on thedrop.
protected override void OnDragDrop(DragEventArgs e)
{
if(e.Data.GetDataPresent("Text"))
{
string path=(string)e.Data.GetData("Text");
//load an image from a file??
}
Invalidate();
base.OnDragDrop(e);
}

Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
> Hello all
>
[quoted text clipped - 10 lines]
> Ravi Singh
> (UCSD)
Pascal Cloup - 04 Jan 2005 18:49 GMT
Hello,
i have just tried it and this works, but only if the i put the code in the
event handlerss of the form. The Event handlers of the Control (a PictureBox
in my case) are never called when draging a file from the desktop.
Is this a normal behaviour?
thanks,
Pascal
> You don't need remoting. You need to handle the DragEnter and DragDrop
> event from the control and decide whether the clipboard contains a format
[quoted text clipped - 76 lines]
>> Ravi Singh
>> (UCSD)
Ravi Singh (UCSD) - 05 Jan 2005 02:52 GMT
Hello Bob
Thanks for replying, as I mentioned in my original post I have the
ability to drag drop pictures within the application. But I wanted to
expand the concept so as to be able to drag drop pictures from
different folders. As Pascal mentioned and I am sure you are aware the
ability of the Drag/Drop event handlers work within the form itself.
So, how do I do this I have been looking into doing it via
IMessageFilter, but little sucess as of now. Anyone have any ideas on
how to do this in C++.
Thanks
Ravi Singh