Maximize and not hide taskbar
-
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
-
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
If
this.WindowState = System.Windows.Forms.FormWindowState.Maximized
doesn't work for you then you're working too hard. -
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
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
-
If
this.WindowState = System.Windows.Forms.FormWindowState.Maximized
doesn't work for you then you're working too hard.It works to a certain extent... It maximizes the window, however; it also maximizes over the top of the task bar :(
-
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
Thanks :) Manage to figure it out using SystemInformation.PrimaryMonitorMaximizedWindowSize and writing the maximze code by hand. :):)
-
It works to a certain extent... It maximizes the window, however; it also maximizes over the top of the task bar :(
Works fine for me, doesn't cover the task bar.
-
Works fine for me, doesn't cover the task bar.
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
-
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