开发者

Using screen.primaryscreen for dual display

开发者 https://www.devze.com 2023-03-17 03:16 出处:网络
I use Screen.PrimaryScreen.Bounds.Height and Screen.PrimaryScreen.Bounds.Width To render my window (i.e it\'s a percentage with all buttons etc derived from this). Will 开发者_运维知识库this

I use

Screen.PrimaryScreen.Bounds.Height

and

 Screen.PrimaryScreen.Bounds.Width

To render my window (i.e it's a percentage with all buttons etc derived from this). Will 开发者_运维知识库this work as expected for dual screens? Are there any situations where it won't work as expected?

Thanks, Richard


You might want to try

System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height 
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width

to avoid problems with users who have larger task bars and things.

example usage of this method can be found on MSDN:

http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.primaryscreen.aspx

you may also find this of interest:

http://msdn.microsoft.com/en-us/library/ms812142.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消