+ 2

How to make a WPF app non-resizeable

I want the window to not be resizeable. I don't want the user going to one edhe and extending it and stuff like that. I want it to be of a fixed size.

21st Aug 2018, 9:28 AM
SiddharthBhandari
SiddharthBhandari - avatar
2 Respostas
+ 1
In the XAML you have a ResizeMode tag. Just like FormBorderStyle in winform. WPF is build to be resizeable so I do not think you should, give all your controls a fixed width and hight. ResizeMode just disables the user to resize the form. That is what you want. https://wpf.2000things.com/tag/resizemode/ <Window x:Class="WPF_ResizeForm.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WPF_ResizeForm" mc:Ignorable="d" Title="MainWindow" Height="350" Width="525" ResizeMode="NoResize">
21st Aug 2018, 6:19 PM
sneeze
sneeze - avatar
0
Thanks for the help
26th Aug 2018, 4:11 AM
SiddharthBhandari
SiddharthBhandari - avatar