C#   发布时间:2022-04-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了c# – 我如何获得屏幕方向?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_618_0@
@H_618_0@
我正在输入要显示表单的屏幕数.我必须得到屏幕方向.有谁知道怎么做?

public UIManager(int screenIndeX)
    {
        this.ScreenIndex = screenIndex;            

        try
        {
            Screen[] all_screens;
            all_screens = Screen.AllScreens;

            if (all_screens.Length >= ScreenIndeX)
            {
                this.customer_form.Left = all_screens[this.ScreenIndex].bounds.Width;
                this.customer_form.Top = all_screens[this.ScreenIndex].bounds.Height;                    
                this.customer_form.Show();
            }
        }
        catch
        {
            //Do nothing
        }
    }

解决方法

您可以使用DisplayInformation.getForCurrentView()返回的Windows.Graphics.Display.DisplayInformation class中的值及其currentOrientation property

DisplayOrientations currentOrientation = Windows.Graphics.Display.DisplayProperties.CurrentOrientation;

来自官方文件

@H_618_0@

大佬总结

以上是大佬教程为你收集整理的c# – 我如何获得屏幕方向?全部内容,希望文章能够帮你解决c# – 我如何获得屏幕方向?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:c#如何屏幕方向获得
猜你在找的C#相关文章
其他相关热搜词更多
phpJavaPython程序员load如何string使用参数jquery开发安装listlinuxiosandroid工具javascriptcap