Thursday, August 14, 2014

How to center a WPF application on center of screen



To center the WPF screen at center add the code at the XAML add attribute WindowStartupLocation and set its property to CenterScreen

WindowStartupLocation="CenterScreen"


<Window x:Class="DemoApplicationMainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        Title="MainWindow" Height="800" Width="850" WindowStartupLocation="CenterScreen"  MaxHeight="9000">

No comments:

Post a Comment