This question already has answers here:
How do I prevent a user from resizing a window in my C# application?
(6 answers)
Closed 9 years ago.
How can I make my application run only with the window maximized?
I am working on a project where I need the window to always be maximized or else the interior designs begin to clump together (please do not comment on the formatting of this app). I understand how to easy it is to set the WindowState to "Maximized" but I need to get rid of the users ability to re-size the application (except the fully minimized option).
Add the following attributes.
ResizeMode="CanMinimize" WindowState="Maximized"
Hope that helps.
More information on the ResizeMode property
You are looking for ResizeMode:
<Window ...
ResizeMode="CanMinimize"
WindowState="Maximized">
Related
This question already has answers here:
How to make a window always stay on top in .Net?
(14 answers)
Closed 5 years ago.
I'm trying to make my Windows Forms stay on top of all programs on my computer.
For example, if I click into a Google Chrome window, I still want the form to be prioritized above it. Is this possible to do?
Have you tried setting the Form.TopMost?
You can just add this to your form:
this.TopMost = true;
Another thing is that you can always put it on top (forcibly) is to make it a dialogbox:
this.ShowDialog();
Hope it helps!
Yes there is one property on Form TopMost you can set true / false.
True - it will be on top
False (by default) - thats why doesn't stat on top by default
of course you can set from code also as #mindOfAi suggested.
This question already has answers here:
How to make a window always stay on top in .Net?
(14 answers)
Closed 8 years ago.
I googled some sites but can't find. I want to keep form on fullscreen game. I make gametool software and that feature is important. I need *VB.NET or C# example for this.
Thank you!
NOT: I saw that topic:How to make a window always stay on top in .Net?. Bu the answer not work on games.
You need to HOOK into the game so you can render with the game (this is a pretty huge topic), unless the game is windowed, in that case you can just force the form to be the top window (Like the link in one of your comments explains).
Beware that this is considered an hack by most anti-cheat software (as it should..).
Things such as Steam are whiteflagged.
This question already has answers here:
Handle a WPF Exit Event
(2 answers)
Closed 8 years ago.
I have an application that uploads a picture to my website. While uploading I would like to temporarily disable the user from closing the program. Is there a way to do this? by either temporarily disabling the close button or by intercepting the close call?
Use the Window.WindowStyle property. I also suggest to don't display the window in the Taskbar.
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Background="AliceBlue" WindowStyle="None" ShowInTaskbar="False" >
</Window>
Anyway, be aware that is not possible to stop a user to close your program, as long as he can access to the Task Manager.
This question already has answers here:
Best way to make Windows Forms forms resizable
(2 answers)
Closed 9 years ago.
I work on VS 2010 with C#. Even thought i set window state to maximum some panels of the form are not fit to screen when changing the resolution. How to solve this problem ?
This doesn't happen automatically. In order to get child controls to change their size with the parent form, you have to set some properties. Specifically, look at the Anchor and Dock properties.
Lots of questions about this already here. I can't do better than Simon's explanation.
As #Cody stated, Anchor and Dock can solve a lot of layout needs. For more complicated layouts, however, you may want to look at utilizing the TableLayoutPanel().
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do you disable Aero Snap in an application?
Is there a way to prevent a WPF window from snapping to screen edges (i.e. Aero snap)?
I know this can be disabled by the user in the OS, but I want to prevent only my window from getting rearranged.
For example, modal windows do not get snapped like that. I imagine it can be set for a WPF window as well, but I do not know how.
There's no direct way of doing this except you set ResizeMode="NoResize" and implement the resize behavior manually or EXTREME SOLUTION could be (on an application basis) modifying a shortcut to your .exe, on the Compatibility tab, check "Disable desktop composition".