728x90
728x170

- 화면 중앙에 출력하기

 

WindowStartupLocation="CenterScreen"

 

- content 에 맞춰 화면 크기 조정하기

 

SizeToContent="WidthAndHeight"

 

 

 

<Window x:Class="WpfApp2.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

        xmlns:src="clr-namespace:WpfApp"

        mc:Ignorable="d"

        WindowStartupLocation="CenterScreen"

        SizeToContent="WidthAndHeight"

        Title="MainWindow" Height="400" Width="600">

    <DockPanel>

    </DockPanel>

</Window>

 

 

 

 

728x90
그리드형

'C# > WPF' 카테고리의 다른 글

[WPF] Custom FrameworkElement 사용하기  (0) 2020.07.10
[WPF] PageFunction  (0) 2020.07.09
[WPF] static member 사용하기  (0) 2020.07.09
[WPF] ContextMenu  (0) 2020.07.08
[WPF] xml 로드하기  (0) 2020.07.08
Posted by kjun.kr
,