How can I set the Windows position on startup

萝らか妹 提交于 2019-12-01 01:57:32

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/42082799/how-can-i-set-the-windows-position-on-startup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!