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. Maximize and not hide taskbar

Maximize and not hide taskbar

Scheduled Pinned Locked Moved C#
csharphelpquestion
8 Posts 4 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
    David Muir
    wrote on last edited by
    #1

    Hey all, I am currently in the middle of writing a custom windows form. (.Net 2.0). I have removed the default border from the form, changed this to a Sizable Border and also set the text of the form to blank so to remove the window caption box. I have now added a custom close, minimize, and maximize button to my form. All works well except for the maximize. On clicking this button, i do wish the form to maximize, which it does, however; it also maxmizes over the top of the task bar. How would i go about stopping this, and letting us view the task bar at all times? I could set the size on the window, however; that would still show the resize borders on the form, which i want to be hidden on maximized state. Help would be greatly appreciated. Thanks TF

    P L E 3 Replies Last reply
    0
    • D David Muir

      Hey all, I am currently in the middle of writing a custom windows form. (.Net 2.0). I have removed the default border from the form, changed this to a Sizable Border and also set the text of the form to blank so to remove the window caption box. I have now added a custom close, minimize, and maximize button to my form. All works well except for the maximize. On clicking this button, i do wish the form to maximize, which it does, however; it also maxmizes over the top of the task bar. How would i go about stopping this, and letting us view the task bar at all times? I could set the size on the window, however; that would still show the resize borders on the form, which i want to be hidden on maximized state. Help would be greatly appreciated. Thanks TF

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      If this.WindowState = System.Windows.Forms.FormWindowState.Maximized doesn't work for you then you're working too hard.

      D 1 Reply Last reply
      0
      • D David Muir

        Hey all, I am currently in the middle of writing a custom windows form. (.Net 2.0). I have removed the default border from the form, changed this to a Sizable Border and also set the text of the form to blank so to remove the window caption box. I have now added a custom close, minimize, and maximize button to my form. All works well except for the maximize. On clicking this button, i do wish the form to maximize, which it does, however; it also maxmizes over the top of the task bar. How would i go about stopping this, and letting us view the task bar at all times? I could set the size on the window, however; that would still show the resize borders on the form, which i want to be hidden on maximized state. Help would be greatly appreciated. Thanks TF

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, with a standard Form, when you look at Form.Bounds in the Resize handler, you will notice maximize typically sets the corners off-screen, e.g. the top left corner to (-4,-4) which is fine when you have a single monitor (the maximized form would protrude on a second monitor if you watch closely). You could forego the built-in maximizing, and do it yourself in as much as you need it. Also SystemInformation.PrimaryMonitorMaximizedWindowSize might be of interest. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


        D 1 Reply Last reply
        0
        • P PIEBALDconsult

          If this.WindowState = System.Windows.Forms.FormWindowState.Maximized doesn't work for you then you're working too hard.

          D Offline
          D Offline
          David Muir
          wrote on last edited by
          #4

          It works to a certain extent... It maximizes the window, however; it also maximizes over the top of the task bar :(

          P 1 Reply Last reply
          0
          • L Luc Pattyn

            Hi, with a standard Form, when you look at Form.Bounds in the Resize handler, you will notice maximize typically sets the corners off-screen, e.g. the top left corner to (-4,-4) which is fine when you have a single monitor (the maximized form would protrude on a second monitor if you watch closely). You could forego the built-in maximizing, and do it yourself in as much as you need it. Also SystemInformation.PrimaryMonitorMaximizedWindowSize might be of interest. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


            D Offline
            D Offline
            David Muir
            wrote on last edited by
            #5

            Thanks :) Manage to figure it out using SystemInformation.PrimaryMonitorMaximizedWindowSize and writing the maximze code by hand. :):)

            1 Reply Last reply
            0
            • D David Muir

              It works to a certain extent... It maximizes the window, however; it also maximizes over the top of the task bar :(

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #6

              Works fine for me, doesn't cover the task bar.

              L 1 Reply Last reply
              0
              • P PIEBALDconsult

                Works fine for me, doesn't cover the task bar.

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                Yeah, I have seen some anomalies over the years, and never figured out all the details; some of these are factors in the end result: - Windows version - taskbar location (mine is typically at the left) - taskbar mode (auto-hide, never hide; I prefer never hide assuming monitor sufficiently large) - the order in which Windows properties get set And for some applications, one wants to cover the task bar whatever the system settings are (e.g. a slide show) :)

                Luc Pattyn [Forum Guidelines] [My Articles]


                - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


                1 Reply Last reply
                0
                • D David Muir

                  Hey all, I am currently in the middle of writing a custom windows form. (.Net 2.0). I have removed the default border from the form, changed this to a Sizable Border and also set the text of the form to blank so to remove the window caption box. I have now added a custom close, minimize, and maximize button to my form. All works well except for the maximize. On clicking this button, i do wish the form to maximize, which it does, however; it also maxmizes over the top of the task bar. How would i go about stopping this, and letting us view the task bar at all times? I could set the size on the window, however; that would still show the resize borders on the form, which i want to be hidden on maximized state. Help would be greatly appreciated. Thanks TF

                  E Offline
                  E Offline
                  Enquiren
                  wrote on last edited by
                  #8

                  Set this property in your load event, or make it a user option: this.MaximizedBounds = SystemInformation.WorkingArea;

                  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