image drag and drop problem
-
Hi, I find that I can drag an jpeg image from IE to MSWord document, but can't drag an image from IE to a c# window form which has already added with both the dragOver and dragDrop events. But I can drag an the image from MSWord document to the C# window form. Why ? Summary for dragging and dropping jpeg image 1. from IE to C# window form : failed 2. from IE to MSWord : OK 3. from MSWord to C# Window form : OK Thanks
-
Hi, I find that I can drag an jpeg image from IE to MSWord document, but can't drag an image from IE to a c# window form which has already added with both the dragOver and dragDrop events. But I can drag an the image from MSWord document to the C# window form. Why ? Summary for dragging and dropping jpeg image 1. from IE to C# window form : failed 2. from IE to MSWord : OK 3. from MSWord to C# Window form : OK Thanks
What is the code in your DragDrop event?
--EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters
-
What is the code in your DragDrop event?
--EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters
-
Thanks for ur reply. The code for the drag drop is void button1_DragDrop(object sender, DragEventArgs e) { object a = e.Data.GetData(DataFormats.Bitmap); this.button1.Image = (Bitmap)a; }
I looked into this a little. It seems that when you drag an image from MS Word, it is in fact a linked or embedded OLE Object. The data object contains a CF_EMBEDDEDOBJECT format that needs to be extracted using "standard OLE techniques". I've never done this before, sorry I can't really help you with it. However, this does explain why you are able to drag and drop images from IE to Word and Win Forms, but not Word to Win Forms.
--EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters