繁体   English   中英

在Windows 10 Tablet模式下强制1/3宽度窗口

[英]Force 1/3 width window in Windows 10 Tablet Mode

在平板电脑模式下,激活我的窗口会使其达到全宽,但我们的软件是一个实用程序,它真正适用于其他程序,需要1/3到1/4宽度。 我可以控制窗口的宽度,并强制与上一个应用程序共享吗?

尝试使用属性System.Windows.SystemParameters.PrimaryScreenWidthSystem.Windows.SystemParameters.PrimaryScreenHeight ,它获取显示的大小WidthHeight (以像素为单位)。

if (System.Windows.SystemParameters.PrimaryScreenWidth < 1500 && 
    System.Windows.SystemParameters.PrimaryScreenHeight < 800)//you should set your own parameters of your Window of Tablet
{                
   Application.Current.MainWindow.Height = Application.Current.MainWindow.Height/3;
   Application.Current.MainWindow.Width = Application.Current.MainWindow.Width/2;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM