How can I set the Windows position on startup

前端 未结 2 858
死守一世寂寞
死守一世寂寞 2021-01-12 15:48

I want to set the position of the window on the right side on the screen similar to WPF. Is there a way in UWP to do this?

相关标签:
2条回答
  • 2021-01-12 16:21

    AFAIK it's not possible in UWP (at least not yet), you can change window size or make it fullscreen by accessing ApplicationView class, but there are no such methods/properties like in WPF.

    There was also similar question on MSDN.

    0 讨论(0)
  • 2021-01-12 16:27

    Yes there is a way :) Go to your xaml for example Windows1.xaml

    then put this there. Example code

     <Window
    x:Class="Poultry_Management_System.Window1"      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Login"
    Width="450"
    WindowStartupLocation="CenterScreen"
    WindowStyle="None"
    ResizeMode="NoResize"
    Topmost="True"
    KeyDown="keyDown_form"
    Height="200">
    

    As you can see my StartupLocation there is in the Center.

    0 讨论(0)
提交回复
热议问题