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. drag & drop problem

drag & drop problem

Scheduled Pinned Locked Moved C#
questionhelp
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.
  • X Offline
    X Offline
    xtremetechnology
    wrote on last edited by
    #1

    let say i have a panel, and in that panel i loaded an image: panel.BackgroundImage = Image.FromFile("image.gif"); Now, i what to make drag & drop with this panel and i want to obtain the name of the image. How can i solve this? When i make the drag & drop operation, can i obtain both the image, and the name of the image? how?

    L 1 Reply Last reply
    0
    • X xtremetechnology

      let say i have a panel, and in that panel i loaded an image: panel.BackgroundImage = Image.FromFile("image.gif"); Now, i what to make drag & drop with this panel and i want to obtain the name of the image. How can i solve this? When i make the drag & drop operation, can i obtain both the image, and the name of the image? how?

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, the way I understand it is you can create any object you like, and pass it to Control.DoDragDrop() when you start dragging, and retrieve it from DragEventArgs.Data when you handle the drop event, so it is possible to store both a file name and a bitmap, or anything else you choose. :)

      Luc Pattyn [My Articles]

      X 1 Reply Last reply
      0
      • L Luc Pattyn

        Hi, the way I understand it is you can create any object you like, and pass it to Control.DoDragDrop() when you start dragging, and retrieve it from DragEventArgs.Data when you handle the drop event, so it is possible to store both a file name and a bitmap, or anything else you choose. :)

        Luc Pattyn [My Articles]

        X Offline
        X Offline
        xtremetechnology
        wrote on last edited by
        #3

        i succed to drag & drop the backgroundImage of the panel to another panel, but i want to obtain the name of the image too. I don't know what is the function which get the name of the image. panel.BackgroundImage = Image.FromFile("pic.gif"); don't exist a function which take an image parameter and return the name and it's path?

        L 1 Reply Last reply
        0
        • X xtremetechnology

          i succed to drag & drop the backgroundImage of the panel to another panel, but i want to obtain the name of the image too. I don't know what is the function which get the name of the image. panel.BackgroundImage = Image.FromFile("pic.gif"); don't exist a function which take an image parameter and return the name and it's path?

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          No, there is no such function. An image can exist without a file; and different files can contain the same image, so what should such a function do in these cases ???

          Luc Pattyn [My Articles]

          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