更改屏幕方向(Windows 7) [英] Change screen orientation (windows 7)

查看:84
本文介绍了更改屏幕方向(Windows 7)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好开发者,

需要访问权限才能通过一次点击设置桌面的屏幕方向。

首先,我想检查屏幕方向是否是水平或垂直。

然后,从状态a一键改为b。

,假设我有2个屏幕,我怎样才能访问辅助屏幕?

到目前为止我所拥有的是:

hello there developers,
need access threw code to set the screen orientation of the desktop by one click.
first, i want to check if the screen orientation is horizontal or vertical.
then, from status a change it to b by one click.
also, assuming i have 2 screens, how can i get access to the secondary screen?
what that i have so far is this:

Dim theScreenHeight As Integer
Dim theScreenWidth As Integer
theScreenHeight = Screen.PrimaryScreen.Bounds.Height
theScreenWidth = Screen.PrimaryScreen.Bounds.Width
If (theScreenHeight > theScreenWidth) Then
   'change to vertical
Else
   'change to horizontal
End If





谢谢你的头,

oron



thanks a head,
oron

推荐答案

很抱歉,我发布了一个信息链接,但是没有用。我认为MSDN上的帖子会说 - 我的错误。通过在互联网上搜索,我发现了更多像已发布的Snippets,它们具有几乎相同的代码。



但是现在我有一个链接为你指导你到工作解决方案: https://www.vb-paradise.de/index.php/Thread/68853-alle-bildschirmaufloesungen-ermitteln-und-wechseln/ [ ^ ]



我希望,链接的论坛是德语版本对你来说不是一个大问题。

你只需要加载ZIP文件和线程的结尾在用户的'Erfinder des Rades'(Wheal的发明者)。



此代码我已经测试过并且有效......;)



问候

拉尔夫
I'm sorry that I posted you a Link with an Information, which isn't working. I thought that posts on MSDN would word - my mistake. By searching in the Internet I found more Snippets like the posted one, which have nearly the same code.

But now I have a Link for you which guides you to a working solution : https://www.vb-paradise.de/index.php/Thread/68853-alle-bildschirmaufloesungen-ermitteln-und-wechseln/[^]

I hope, that it is not a big problem for you that the linked Forum is a German one.
You only have to load the ZIP-File and the end of the Thread at the User 'Erfinder des Rades' (Inventor of the Wheal).

This Code I have tested and it works ... ;)

Greetings
Ralf


如果你想要第二个scr een(和其他屏幕)。你循环浏览Screen.AllScreens,所有不等于Screen.PrimaryScreen的是第2,第3等屏幕。



在c#中是这样的:

If you wnat the second screen (and additional screens). You loop through Screen.AllScreens and all that are not equal to the Screen.PrimaryScreen is the 2nd, 3rd, etc... screen.

In c# something like this:
var otherScreens = Screen.AllScreens.Where(x => x != Screen.PrimaryScreen);





祝你好运!



Good luck!


我发现: https://social.msdn.microsoft.com/Forums/vstudio/en-US/6318a324-99ff-4368-87be-423ee96a8399/chaning-screen-resolutions-from-vbnet-application [ ^ ]


这篇关于更改屏幕方向(Windows 7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆