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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. constraining somthing in a panel control

constraining somthing in a panel control

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

    I'm trying to constrain a graphics object in a panel control (like drawing a square that moves in the panel that stops at the panel line) I am trying to use the Panel.Left and Panel.Right etc in a if (x <= Panel.Left) x = x - 10; else x = Panel.Left; but it is not constrained by this... Is there another way? The rectangle structure is Rectangle(x,y,10,10)

    K 1 Reply Last reply
    0
    • D djkno3

      I'm trying to constrain a graphics object in a panel control (like drawing a square that moves in the panel that stops at the panel line) I am trying to use the Panel.Left and Panel.Right etc in a if (x <= Panel.Left) x = x - 10; else x = Panel.Left; but it is not constrained by this... Is there another way? The rectangle structure is Rectangle(x,y,10,10)

      K Offline
      K Offline
      Kannan Kalyanaraman
      wrote on last edited by
      #2

      My guess is you will have to use a combination of mousecapture and hittest. Cheers Kannan

      D 1 Reply Last reply
      0
      • K Kannan Kalyanaraman

        My guess is you will have to use a combination of mousecapture and hittest. Cheers Kannan

        D Offline
        D Offline
        djkno3
        wrote on last edited by
        #3

        I figured it out :D my problem wasn't that I was going outside the panel it was the line redrawing when it hit the side and erasing the part by the panel.

        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