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. Reorder

Reorder

Scheduled Pinned Locked Moved C#
questioncsharphelp
3 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.
  • S Offline
    S Offline
    shamsteady
    wrote on last edited by
    #1

    i had write this code using c# to do drag and drop. But it just for drag and drop. i need it to reorder itself after the drag and drop. how can i fix this code to do the reorder? private bool isDragging=false; public int x,y; private void panel1_MouseDown(System.Object sender, System.Windows.Forms.MouseEventArgs e) { isDragging = true; x = e.X; y = e.Y; } private void panel1_MouseUp(System.Object sender, System.Windows.Forms.MouseEventArgs e) { isDragging = false; } private void panel1_MouseMove(System.Object sender, System.Windows.Forms.MouseEventArgs e) { if (isDragging == true) { panel1.Left = e.X + panel1.Left - x; panel1.Top = e.Y + panel1.Top - y; }

    S 1 Reply Last reply
    0
    • S shamsteady

      i had write this code using c# to do drag and drop. But it just for drag and drop. i need it to reorder itself after the drag and drop. how can i fix this code to do the reorder? private bool isDragging=false; public int x,y; private void panel1_MouseDown(System.Object sender, System.Windows.Forms.MouseEventArgs e) { isDragging = true; x = e.X; y = e.Y; } private void panel1_MouseUp(System.Object sender, System.Windows.Forms.MouseEventArgs e) { isDragging = false; } private void panel1_MouseMove(System.Object sender, System.Windows.Forms.MouseEventArgs e) { if (isDragging == true) { panel1.Left = e.X + panel1.Left - x; panel1.Top = e.Y + panel1.Top - y; }

      S Offline
      S Offline
      sam
      wrote on last edited by
      #2

      onMouseUp Event Check if isDragging id true the check the location of other control and then reorder accordingly

      S 1 Reply Last reply
      0
      • S sam

        onMouseUp Event Check if isDragging id true the check the location of other control and then reorder accordingly

        S Offline
        S Offline
        shamsteady
        wrote on last edited by
        #3

        Thanks for the idea. It's very useful. But i have the problem to check the location of other control. Can you give a example or idea?

        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