vs 2005 changes my form size(?)

G

greg.merideth

I inherited a vs2003 project which I've converted into vs2005 to run
under .net 2.0. The conversion was fine and the project compiles and
runs just fine until today. A user called me up asking why they cannot
see the bottom of the form anymore (it's a fixed height form).

I opened the project again and looked at the form and sure enough, it's
exactly 180 pixels less than it used to be. Thinking I messed up, I
fixed the form, recompiled and everyone was happy....until today. I
opened the project to start the redesign into vs2005 and when I opened
the form in the designer VS made the form 180 pixels smaller. I
dragged out the height, saved, exited, started again and once again,
the damm designer shrinks the form.

I've had to add code in now to set the form height when run, just in
case it happens again, but has anyone else run into this?

I've never had this happen with a new project started in vs2005.
 
G

greg.merideth

The autosize is set to false and the forms size is set in the form
designer. While annoying it's not a major thing as I'm recreating this
project from scratch to clear out some of the 'wtf' code. This form
resize issue is part of that 'wtf'.
 
C

Chris Dunaway

What is the size of the form and what is the resolution of the screen?
You cant create a form that is larger than the resolution of the
screen. We ran into this issue when trying to design for a screen that
is larger than the development monitor could support. We had to get
new monitors to develop at the correct size.

You might also check the resolution on all the machines to see if they
are at 72dpi or 96dpi or even higher. Perhaps differences there might
be causing a problem.
 
G

greg.merideth

I'm developing at 1920x1280 and the form size is fixed at 800x800.
This appears to be limited to my machine as others have opened the
project under vs2005 and it hasn't pulled it's form-size changing bit
on their machines. I've got a number of extensions I use in VS so I'm
poking around seeing if one of them is doing it.
 
D

_DD

I'm developing at 1920x1280 and the form size is fixed at 800x800.
This appears to be limited to my machine as others have opened the
project under vs2005 and it hasn't pulled it's form-size changing bit
on their machines. I've got a number of extensions I use in VS so I'm
poking around seeing if one of them is doing it.

Greg,

Not sure if this is relevant, but there are differences between the
code from a VS2003-generated form and VS2005. If it's a scaling
problem, you could try changing to the newer float format to see if
that helps.

While I haven't seen an problems created by porting VS2003 code, this
could be the source of what you're seeing.

Note, in the code below:
2003 uses AutoScaleBaseSize ... DrawingSize(5, 13)
2005 uses AutoScaleDimensions ... DrawingSizeF(6F, 13F)

2005 also adds AutoScaleMode()...

Excerpt from generated code from similar sized forms:

VS2003:
//
// Form1
//this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}

VS2005:
//
// Form1
//this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}

I initially thought that you'd need to change the float '6F' to '5F'
to stay the same size as the 2003-generated code, but this does not
appear to be the case.

Off-subject: What type of LCD are you using at 1920x1200? I just saw
a Samsung wide-screen (242?) next to a Sony and the Samsung looked
brighter and more vibrant. Do you have to set a custom font scaling
to read code all day without fatigue?

Please follow up if you manage to fix this. I'm curious about effects
of porting 2003 code.
 
G

greg.merideth

Well hot damm. I had set the .AutoScaleDimensions manually after the
conversion to 2005 yet I never set .AutoScaleMode. After setting
AutoScaleMode I can open the form without VS shrinking the form size on
me. It's always the small things...


As far as the monitor goes I have the Dell FP 24" monitor and I sit
back around 26 inches from the screen and I can read the font in VS at
standard 10 point Courier without a problem nor do I get eye strain.
The only drawback I find is siting down at other people's monitors to
look at code I feel like I'm stepping down to a 14" grayscale monitor.
With the Dell monitor (I don't know about the Samsung) you can rotate
the whole monitor around 90 degrees and get a portrait view of your
code.
 
D

_DD

Well hot damm. I had set the .AutoScaleDimensions manually after the
conversion to 2005 yet I never set .AutoScaleMode. After setting
AutoScaleMode I can open the form without VS shrinking the form size on
me. It's always the small things...

That's one of the tricky aspects of porting old code. I did quite a
few forms before I got the hang of it. The cool thing about VS2005,
of course, is that you can now split all the ugly pre-generated code
into a separate module, thanks to partial classes.

I usually port VS2003 code by generating a new empty project with a
form and one button. That gives me location within the source files
where the compiler is storing controls (that has shifted around in
VS2005). I swap the old controls in for the button, change the form
size in the functions we talked about, and a couple other minor
things.
As far as the monitor goes I have the Dell FP 24" monitor and I sit
back around 26 inches from the screen and I can read the font in VS at
standard 10 point Courier without a problem nor do I get eye strain.

Good to know. I was also looking at the Dell monitor, but I haven't
seen one in person yet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top