VS2005 has a bad habit of shrinking my form every time I compile. I doubt
if there's a solution to this problem (besides Microsoft's fixing the bug),
but I'm curious if anyone else has experienced the same thing.
The Story: I converted a C# project from VS2003 to 2005. Ever since then,
my form shrinks exactly 20 vertical pixels whenever I compile with the
designer window open. This is repeatable; It happens every single time.
I tried turning autoscale off and making the form's font the default, to no
avail. I even tried making the form's source file read-only, but the
compiler ignores this attribute and modifies the file anyway.
Please don't suggest that I start the project from scratch under VS2005.
That will probably get rid of the problem, but it doesn't explain this odd
behavior. Shrinking the form by 20 pixels every time sounds so deliberate
that it just has to be a feature gone wrong, and ought to be fixed.
pvdg42 - 26 Jan 2006 05:10 GMT
> VS2005 has a bad habit of shrinking my form every time I compile. I doubt
> if there's a solution to this problem (besides Microsoft's fixing the
[quoted text clipped - 15 lines]
> behavior. Shrinking the form by 20 pixels every time sounds so deliberate
> that it just has to be a feature gone wrong, and ought to be fixed.
You don't mention the project or template types. Is this a Windows
application?
If it is, the problem you cite is not reproducible here. I've test-converted
three different VS 2003 C# Windows apps to VS 2005 and rebuilding with the
designer window open has no effect on the form dimensions. I also did a
quick search for other reports of similar problems and found none, so I'm
thinking it's something unique to your hardware/OS environment.
I've had a "special" issue with VS 2005 myself, where installations on a
couple of machines had issues with rebuilding C++ apps. Attempts to rebuild
produced dialogs claiming certain VS 2005 dll's were missing. Building the
same apps went fine. I posted in the appropriate groups, reported it on the
VS forum:
http://lab.msdn.microsoft.com/productfeedback/default.aspx
Nobody had seen it and nobody could reproduce it. I subsequently installed
VS 2005 on a newly built machine and the bug did not appear. I'm mystified.
You might consider reporting your bug through the link above.
Phil Blake - 26 Jan 2006 15:35 GMT
> You don't mention the project or template types. Is this a Windows
> application?
Yes.
> I also did a quick search for other reports of similar
> problems and found none, so I'm thinking it's something unique to your
> hardware/OS environment.
Thanks for taking the time. It doesn't surprise me that you weren't able to
reproduce it. I've done an exhaustive search and found no one who had the
exact same problem. One of my coworkers is struck by the magical shrinking
form from time to time, but isn't able to get it consistently. I, on the
other hand, could literally do nothing but press the compile button over and
over, and watch the form shrink away to nothing, 20 pixels at a time.
> You might consider reporting your bug through the link
> above.
I think I'll send them a movie of it happening. It is a sight to see.
Peter Franks - 26 Jan 2006 06:08 GMT
> VS2005 has a bad habit of shrinking my form every time I compile. I doubt
> if there's a solution to this problem (besides Microsoft's fixing the bug),
[quoted text clipped - 12 lines]
> behavior. Shrinking the form by 20 pixels every time sounds so deliberate
> that it just has to be a feature gone wrong, and ought to be fixed.
Does your form derive from Form, or from something else?
I'm guessing that this is a problem in your form's InitializeComponent()
code. Visually examine the generated code section and see if there is
anything that may be manipulating the size.
Another thing that you can try is to create another form from scratch,
select all in the original form and past into the new form. Then run a
diff between the forms and see what the differences are (presuming the
shrink behavior doesn't happen in the new form).
Phil Blake - 26 Jan 2006 15:42 GMT
> Does your form derive from Form, or from something else?
From System.Windows.Forms.Form.
> I'm guessing that this is a problem in your form's
> InitializeComponent() code. Visually examine the generated code
> section and see if there is anything that may be manipulating the
> size.
It just looks like the regular old InitializeComponent(). Comparing the
file before and after the shrink shows that the only thing that changed is
the height of the form.
> Another thing that you can try is to create another form from scratch,
> select all in the original form and past into the new form.
I'm afraid that's what it will come down to. My guess is that there will
be a ton of differences between the converted and from-scratch projects,
and the bug will be hidden in some combination of differences that has
nothing to do with anything.
Oenone - 26 Jan 2006 16:26 GMT
> The Story: I converted a C# project from VS2003 to 2005. Ever since
> then, my form shrinks exactly 20 vertical pixels whenever I compile
> with the designer window open. This is repeatable; It happens every
> single time.
Not that this will be of any direct help, but could you make a simple sample
project that exhibits the problem and post it to Microsoft's Product
Feedback page? If it's a bug they will hopefully be able to fix it for the
next service pack...
http://lab.msdn.microsoft.com/ProductFeedback/

Signature
(O)enone
Ricky - 09 Mar 2006 15:58 GMT
I think i have the same problem:
I have one form that in design time looks diferent (in size, its smaller)
than in running time(I don´t know how many pixels).
If I make another project and I add this form it looks good (it has the same
size in design-running time). ¿? .
I have VS2003.
"Phil Blake" escribió:
> VS2005 has a bad habit of shrinking my form every time I compile. I doubt
> if there's a solution to this problem (besides Microsoft's fixing the bug),
[quoted text clipped - 12 lines]
> behavior. Shrinking the form by 20 pixels every time sounds so deliberate
> that it just has to be a feature gone wrong, and ought to be fixed.