473,790 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2851
Try this:
-disable maximize button;
-set the WindowState to Normal;
-set StartPosition to CenterScreen;
-in Form constructor, after InitializeCompo nent(); do this :
Screen s = Screen.AllScree ns[0];
this.Size = new Size(s.WorkingA rea.Width + 1,
s.WorkingArea.H eight + 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 InitializeCompo nent(); do this :
Screen s = Screen.AllScree ns[0];
this.Size = new Size(s.WorkingA rea.Width + 1,
s.WorkingArea.H eight + 1);

Jun 12 '07 #3
On Tue, 12 Jun 2007 01:52:00 -0700, pete1969
<pe******@discu ssions.microsof t.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******@discu ssions.microsof t.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
1652
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 are there other alternatives for how to set up this form http://www.teachercards.org/Data_Form.php TIA David
2
1385
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. Does anyone have insight into how this is done or if there are limitations to saving in this manner. The best I've been able to do is to open the form, goto Windows-Fit Form to Window and then save which opens the form close to being maximized. ...
1
4852
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 should open as maximized. (2) When clicking a button on any FORM-A launches FORM-B, FORM-B should also open as maximized. (i would like all forms to be always
2
12600
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 Word). How do i do that ? Thanks
1
2187
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 indeed Maximized. However: 1. The Maximized state of my form does not take the Windows taskbar state into consideration. The form behaves as if the user has their taskbar set to "autohide", even if they do not. The app extends all the way down...
1
9457
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 when the form is in its minimal size. However, when the form is maximized using the appropriate button the code that is supposed to set the location is ignored. When the form is switched back to the standard dimensions through the restore...
7
9902
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 reproduce this by showing the following form: Public Class Form1 Inherits Windows.Forms.Form Public Sub New() MyBase.New() Me.ControlBox = False
3
2217
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 newly created menu - Create mdi child form and set it's window state to Maximized When you run the project and open the child form, the menus are merged properly, but the form appears the same size as it does at design time (rather than...
4
2898
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 change. I tried updating the form's Bounds property in the panel's SizeChanged event but this does not work because the Bounds property seems to be ignored until the form is restored to the normal state. I also tried using the form's...
2
3159
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 me Datasheet view. Dialog mode won't give me Datasheet view I could make Form01 Restore size and expand it to fill the Window in Restore size (maybe DoCmd.MoveSize Right, Down, Width, Height) - I don't want this.
0
10412
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3703
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.