views:

37

answers:

2

Hi all, I'm having the weirdest problem here with a Windows App written in c#.

Although there is absolutely nothing special about it, the main window works perfectly well on the Primary monitor and on any Secondary monitor when the latter is configured to stand on the right of the Primary monitor. However, when I reconfigure the secondary screen to be placed on the left side of my Primary monitor, I (and others) no longer can change the size of the form. The mouse-pointer does NOT change into the 'NW-SE-arrows', nor does clicking & dragging the edge react in any change towards the size of the window.

Doing some extra experimenting this seems to surface only when I have the AutoSizeMode of the form set to GrowAndShrink !?

Is this some kind of bug or am I misinterpreting the property ?

To reproduce this problem you should

  • start a new WinForms project
  • Add a StatusStrip to the bottom of the form
  • Run the project (Debug/Any CPU in my case)
  • Drag the form to the secondary monitor that stands LEFT of your primary monitor

PS: it seems that when I remove the StatusStrip, I can't resize the form at all, so I'm guessing this is some side-effect/bug in the StatusStrip object...

A: 

If you can't resize with the StatusStrip not on the form, then there is another issue going on here. All forms should be resizable unless you set the FormBorderStyle property to a Fixed style.

davisoa
FormBordeStyle is set to SizeAble. Frankly, I haven't touched any properties except for name, text and AutoSizeMode.
deroby
Adding a checkbox with the following code behind makes it pretty clear that the issue revolves around the AutoSizeMode propertyprivate void chkAutoGrowAndShrink_CheckedChanged(object sender, EventArgs e){ this.AutoSizeMode = chkAutoGrowAndShrink.Checked ? AutoSizeMode.GrowAndShrink : System.Windows.Forms.AutoSizeMode.GrowOnly;} // sorry about missing layout, seems the comment-box eats most of it...
deroby
Hmmm... Very confusing then.
davisoa
A: 

I am experiencing this behavior too on Win7x64 with NVIDIA Quadro NVS 140M video adapter.

  • on primary monitor, window is resizable regardless of whether it is the left or right display.
  • on secondary monitor, window is resizable when it is to the right of the primary monitor, but not when it is left of the primary monitor.
Eoan