Yogesh
Yogesh

Reputation: 849

Opening Window Its own Minheight and MinWidth

I want to open a window with its own MinHeight and MinWidth, without setting SizeToContent property and without specifying any Height and Width of window in WPF. Kindly let me know how can I achieve the same in WPF. Thanks

Upvotes: 2

Views: 375

Answers (1)

Mitesh
Mitesh

Reputation: 66

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">

Upvotes: 0

Related Questions