Using screen.primaryscreen for dual display
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
精彩评论