| | |
C# Maximized Forms Are Still Movable And resizeable
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
0
#2 Nov 9th, 2009
How are you maximizing the form in code and how are you disabling the maximimize box? If you set the height and width to the entire screen then it is not truly maximized and it will let you move and resize the form. If you send it a maximize window message then it won't. This is how you should maximize it:
You can also toggle between maximized and normal state by double clicking on the form's header and right clicking on the item in the windows task bar -- unless you have disabled those too.
C# Syntax (Toggle Plain Text)
private void frmMaximize_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; }
You can also toggle between maximized and normal state by double clicking on the form's header and right clicking on the item in the windows task bar -- unless you have disabled those too.
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
0
#3 Nov 9th, 2009
•
•
•
•
How are you maximizing the form in code and how are you disabling the maximimize box? If you set the height and width to the entire screen then it is not truly maximized and it will let you move and resize the form. If you send it a maximize window message then it won't. This is how you should maximize it:
C# Syntax (Toggle Plain Text)
private void frmMaximize_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; }
You can also toggle between maximized and normal state by double clicking on the form's header and right clicking on the item in the windows task bar -- unless you have disabled those too.
C# Syntax (Toggle Plain Text)
this.WindowState = FormWindowState.Maximized;
It will still allow me to move and resize my form if the maximize box in the task bar is set to disabled.
If the maximize box in the task bar is set to enabled and I maximize my form with the code I cannot move the form.
Any ideas to why this works this way??
•
•
Join Date: Jul 2009
Posts: 972
Reputation:
Solved Threads: 213
0
#4 Nov 9th, 2009
Setting the form's property
Setting the form's property
As far as moving the form when maximized, you should not be able to do this, which also relates to your question: "Any ideas to why this works this way?" Maximized form fills the screen, though I don't know how this relates to virtual screens...
this.MaximizeBox = false; prevents the form from being maximized as far as I can tell. Are you saying this is not so in your case?Setting the form's property
this.FormBorderStyle to one of the fixed border styles will prevent it from being sizeable (eg. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; . See FormBorderStyle...As far as moving the form when maximized, you should not be able to do this, which also relates to your question: "Any ideas to why this works this way?" Maximized form fills the screen, though I don't know how this relates to virtual screens...
![]() |
Similar Threads
- Using Graphics Pointer to Draw objects(TREE) in a Class (Windows Forms Applications) (C++)
- Code Snippet: Passing data between forms (C#)
- Windows Forms and remote thread (C++)
- Handling docuemnt.forms[0] in FireFox (JavaScript / DHTML / AJAX)
- Problem with 2 forms (C#)
- News Story: Web forms are still the gateway to security hell (Network Security)
- Forms in Random access files (Visual Basic 4 / 5 / 6)
- place forms in a project in a fixed posion (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: C# in Voice to Text
- Next Thread: C#Net2003 - Add CheckBox in DataGrid
Views: 372 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client code color control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms ftp function gcd gdi+ http httpwebrequest image index input java list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving server sleep socket sql statistics stream string table textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






