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. Limiting window movement

Limiting window movement

Scheduled Pinned Locked Moved C#
help
2 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
    sixefftee
    wrote on last edited by
    #1

    Background of my goal: I've been asked to simulate a mdi in a mdi to do this i'm trying to limit a user from moving a form beyond the bounds of what will be considered the a main form (keep in mind the parent is not mdi just and owner and it has to be that way) My desire: I want limit a windows movement to an area i set in code. I been able to do this by set the location property when it hits a boundary but this causes a lot of flicking. I tried setting the capture property to false but that then the form snaps back to its orginal position before the move. So thats where i am. I either want to be able to stop the form from flicking or stop it from snapping back the orginal position. any help is greatly appreciated.

    J 1 Reply Last reply
    0
    • S sixefftee

      Background of my goal: I've been asked to simulate a mdi in a mdi to do this i'm trying to limit a user from moving a form beyond the bounds of what will be considered the a main form (keep in mind the parent is not mdi just and owner and it has to be that way) My desire: I want limit a windows movement to an area i set in code. I been able to do this by set the location property when it hits a boundary but this causes a lot of flicking. I tried setting the capture property to false but that then the form snaps back to its orginal position before the move. So thats where i am. I either want to be able to stop the form from flicking or stop it from snapping back the orginal position. any help is greatly appreciated.

      J Offline
      J Offline
      John Fisher
      wrote on last edited by
      #2

      I've never tried to keep a window position from going too far to the top or the left, but the WM_GETMINMAXINFO message and the related MINMAXINFO structure were designed to limit sizing and maximized window positioning. Check that out. It may be the solution you need. John
      "You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.

      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