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. Drawing a drag rectangle -- pls help.

Drawing a drag rectangle -- pls help.

Scheduled Pinned Locked Moved C#
graphicshelpquestion
2 Posts 1 Posters 13 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I have an application that allows users to, using the mouse, click and hold a control and move it to another location on the form. How do I draw that un-filled drag rectangle that shows the user that they are moving something around. I need to be able to draw this drag rectangle anywhere on the screen (on the app, over other controls, on the desktop) not just on the application itself. Your help is appreciated.

    L 1 Reply Last reply
    0
    • L Lost User

      I have an application that allows users to, using the mouse, click and hold a control and move it to another location on the form. How do I draw that un-filled drag rectangle that shows the user that they are moving something around. I need to be able to draw this drag rectangle anywhere on the screen (on the app, over other controls, on the desktop) not just on the application itself. Your help is appreciated.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The class 'System.ControlPaint' has some methods with the name 'Reversible' in them that draw onto the screen. If you use FillReversibleRectangle then you could draw four of them to get the drag rectangle you are looking for. There is only one problem with this though, you have to give a Color and so it will be a solid border around your control and not the stipled effect you want.

      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