473,395 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

maximized form

I want to have an application window be always maximized (or minimized) but
never in normal state. If I take away the maximize button in the form and
start the application in maximized mode the user can still double click on
the title bar to unmaximize it, but never maximize it afterwards. Is there a
way to solve this?
Jun 12 '07 #1
4 2831
Try this:
-disable maximize button;
-set the WindowState to Normal;
-set StartPosition to CenterScreen;
-in Form constructor, after InitializeComponent(); do this :
Screen s = Screen.AllScreens[0];
this.Size = new Size(s.WorkingArea.Width + 1,
s.WorkingArea.Height + 1);

Jun 12 '07 #2
Unfortunately it doesn't. This way the window is still movable and it's not
in fullscreen mode so if someone changes the screen resolution (to adapt to a
beamer from a notebook) the window will not adapt its content to the new
screen resolution ...

"eusebiu" wrote:
Try this:
-disable maximize button;
-set the WindowState to Normal;
-set StartPosition to CenterScreen;
-in Form constructor, after InitializeComponent(); do this :
Screen s = Screen.AllScreens[0];
this.Size = new Size(s.WorkingArea.Width + 1,
s.WorkingArea.Height + 1);

Jun 12 '07 #3
On Tue, 12 Jun 2007 01:52:00 -0700, pete1969
<pe******@discussions.microsoft.comwrote:
I want to have an application window be always maximized (or minimized)
but
never in normal state. If I take away the maximize button in the form and
start the application in maximized mode the user can still double click
on
the title bar to unmaximize it, but never maximize it afterwards. Is
there a
way to solve this?
I haven't tried this, but you may be able to address the issue by handling
the WM_SYSCOMMAND message in the WndProc method of your main application
form class. Watch for the SC_RESTORE message, and don't call the base
WndProc method when it shows up.

It's my expectation that when the user double-clicks on the title bar,
this is the message that's sent if the window is already maximized, and so
ignoring it will prevent the window from being un-maximized.

Pete
Jun 12 '07 #4
Thanks, that was the hint I was looking for. I wasn't aware that there is a
wndProc method in C#, too. I'm coming from C++ and was hoping, I would never
have to deal with messages outside of some kind of an editor. Guess, I was
terribly wrong here ...

"Peter Duniho" wrote:
On Tue, 12 Jun 2007 01:52:00 -0700, pete1969
<pe******@discussions.microsoft.comwrote:
I want to have an application window be always maximized (or minimized)
but
never in normal state. If I take away the maximize button in the form and
start the application in maximized mode the user can still double click
on
the title bar to unmaximize it, but never maximize it afterwards. Is
there a
way to solve this?

I haven't tried this, but you may be able to address the issue by handling
the WM_SYSCOMMAND message in the WndProc method of your main application
form class. Watch for the SC_RESTORE message, and don't call the base
WndProc method when it shows up.

It's my expectation that when the user double-clicks on the title bar,
this is the message that's sent if the window is already maximized, and so
ignoring it will prevent the window from being un-maximized.

Pete
Jun 14 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Willoughby Bridge | last post by:
How do you get a form to always open in the maximized mode (covering the whole screen). My form looks goofy when it is not maximized. If there is no way for the screen to always open maximized...
2
by: jeffgeorge | last post by:
I've been trying everything between setting a bunch of different form properties and saving the form as it's maximized and I am not able to save the form so each time it opens, it is maximized. ...
1
by: ssb | last post by:
Hello, One form in my application is the MAIN form. It is set up as "startup" form. However, I need to do the following: (1) When I double click MDE file to launch my project, the MAIN form...
2
by: developer | last post by:
I have a form with a menu on the top. This menu show another form. I want to open this second form maximized inside the parent form just below the menu of the parent form. (Like Microsoft...
1
by: 1388-2/HB | last post by:
For vb2005. At design time I set the main form's WindoState to Maximized and I disabled the Maximize box. The user can Minimize the application only. When the program launches, the form is...
1
by: Marc the Demi-Programmer | last post by:
I am overriding WncProc to make sure my form's location stays within specified parameters. Basically, it has to stay at the top of the screen and not be off to either of the sides. All that works...
7
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I've noticed that a form will cover the taskbar when it is maximized if its ControlBox property is set to false (even if the "Keep the taskbar on top of other windows" option is selected). You can...
3
by: =?Utf-8?B?Sm9l?= | last post by:
Can anyone tell me if this is a confimed bug and if there is a workaround: - Create an form set as an mdi container - Add a Menustrip to mdi container and set form's MainMenuStrip property to...
4
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I have a situation where I need to display a form in a panel. Everything works great except if the form is maximized and the panel's size changes. In this case the maximized form's bounds do not...
2
by: Alan Forsyth | last post by:
That rather long subject says it. In Access97 running on XP - I want to display a Maximized size Form01, then open a Restore size Datasheet View Form02 on top of the first Form. PopUp won't give...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.