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. Docking a Windows Form to the edge of a screen

Docking a Windows Form to the edge of a screen

Scheduled Pinned Locked Moved C#
csharpcom
4 Posts 3 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.
  • J Offline
    J Offline
    Jordanwb
    wrote on last edited by
    #1

    What I want to do is be able to stick a form to the top, left, right or bottom of the screen - all the way across. I found this: http://www.codeproject.com/KB/dialog/FormDocker.aspx but I don't know how I would use a VB class in a C# project, plus I don't want to have to install the VB component of VS2008 just to compile a class.

    S J 2 Replies Last reply
    0
    • J Jordanwb

      What I want to do is be able to stick a form to the top, left, right or bottom of the screen - all the way across. I found this: http://www.codeproject.com/KB/dialog/FormDocker.aspx but I don't know how I would use a VB class in a C# project, plus I don't want to have to install the VB component of VS2008 just to compile a class.

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

      My.Computer.Screen.WorkingArea.[Width, Height, Top, Bottom] and use them according to your needs.

      1 Reply Last reply
      0
      • J Jordanwb

        What I want to do is be able to stick a form to the top, left, right or bottom of the screen - all the way across. I found this: http://www.codeproject.com/KB/dialog/FormDocker.aspx but I don't know how I would use a VB class in a C# project, plus I don't want to have to install the VB component of VS2008 just to compile a class.

        J Offline
        J Offline
        Jordanwb
        wrote on last edited by
        #3

        I found this: http://www.codeproject.com/KB/shell/csdoesshell3.aspx?msg=2799390#xx2799390xx but the window disapeers when I press Windows+D, how could I catch the Windows+D key sequence?

        L 1 Reply Last reply
        0
        • J Jordanwb

          I found this: http://www.codeproject.com/KB/shell/csdoesshell3.aspx?msg=2799390#xx2799390xx but the window disapeers when I press Windows+D, how could I catch the Windows+D key sequence?

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

          You don't want to catch Windows+D, that's a standard keyboard-shortcut to "Show Desktop". You wouldn't be happy if some programmer decided to hijack ctrl-alt-del, now would you? Even if you succeeded, I could always right-click the taskbar and select "Minimize All" and the effect would be the same. The good news is that Microsoft has made it hard to catch the key-sequence. The bad news is that you don't even have to catch that key.. Set your window to be the TopMost one, and restore your form in the OnMinimize-handler. HTH,

          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