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. how can i move a rectangular from one position to another

how can i move a rectangular from one position to another

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

    i have already draw many rectangle inside a form how can i move the rectangular form one position to another after i have selected the rectangular to move.

    D 1 Reply Last reply
    0
    • C chiou

      i have already draw many rectangle inside a form how can i move the rectangular form one position to another after i have selected the rectangular to move.

      D Offline
      D Offline
      draco_iii
      wrote on last edited by
      #2

      You can do this by changing the Rectangle Draw points and then redraw the object. Rectangle DrawRectangle = new Rectangle(4,4,50,50); private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { e.Graphics.DrawRectangle(System.Drawing.Pens.Beige, DrawRectangle); } private void button1_Click(object sender, System.EventArgs e) { DrawRectangle = new Rectangle(20,20,50,50); panel1.Invalidate(); }

      C 1 Reply Last reply
      0
      • D draco_iii

        You can do this by changing the Rectangle Draw points and then redraw the object. Rectangle DrawRectangle = new Rectangle(4,4,50,50); private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { e.Graphics.DrawRectangle(System.Drawing.Pens.Beige, DrawRectangle); } private void button1_Click(object sender, System.EventArgs e) { DrawRectangle = new Rectangle(20,20,50,50); panel1.Invalidate(); }

        C Offline
        C Offline
        chiou
        wrote on last edited by
        #3

        thanx for your tips.i want to ask i have a lot of rectangle in the form how can i know which rectangle i have select to move and can i remain the size of the rectangle when i move and can i see the effect of the move when i move the rectangle.thank you for help me answer the question.

        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