Form.Bounds with 2 screens
I have 2 screens, and 2 forms. I wa开发者_高级运维nt each form to fill a screen, so I did the following code:
s = Screen.AllScreens
f1.Bounds = s(0).Bounds
f2.Bounds = s(1).Bounds
(s(0) is my primary screen, and s(1) is above it.) F1 fills s(0), but f2 does not fill s(1). The size of f2 is set correctly but the location is set to (50, 0) instead of (0, -1024). Maybe location won't accept negative numbers? If so, how can I get my form to the other screen?
EDIT
When you manually set the position of your form, you also have to set the StartPosition
property to Manual
, otherwise it doesn't work.
Move your code for setting the bounds into the Form_load of each of the forms. I was seeing the same thing you are and when I put the code into the Form_Load it worked as expected.
精彩评论