Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. image drag and drop problem

image drag and drop problem

Scheduled Pinned Locked Moved C#
csharphelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kim0618
    wrote on last edited by
    #1

    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

    E 1 Reply Last reply
    0
    • K Kim0618

      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

      E Offline
      E Offline
      Eric Dahlvang
      wrote on last edited by
      #2

      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

      K 1 Reply Last reply
      0
      • E Eric Dahlvang

        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

        K Offline
        K Offline
        Kim0618
        wrote on last edited by
        #3

        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; }

        E 1 Reply Last reply
        0
        • K Kim0618

          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; }

          E Offline
          E Offline
          Eric Dahlvang
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups