开发者

Opening Window Its own Minheight and MinWidth

开发者 https://www.devze.com 2023-03-19 08:22 出处:网络
I want to open a window with its own MinHeight and MinWidth, without setting SizeToContent property and without specifying any Height and Width of w开发者_如何转开发indow in WPF. Kindly let me know ho

I want to open a window with its own MinHeight and MinWidth, without setting SizeToContent property and without specifying any Height and Width of w开发者_如何转开发indow in WPF. Kindly let me know how can I achieve the same in WPF. Thanks


If you want your window should open based on the size specified in MinHeight and MaxHeight without specifying SizeToContent property then you need to set MaxHeight and MaxWidth also. You need to set the same value to Maxheight and Maxwidth properties. Try below XAML snippet

<Window x:Class="WPFTestApplication.Test1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Test1" MinHeight="100" MinWidth="100"
    MaxHeight="100" MaxWidth="100"
    SizeToContent="Manual">
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号