473,473 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

vs 2005 changes my form size(?)

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.

Apr 5 '06 #1
7 2308
Check the AutoSize property on your form. It might be set to true.

"gr***********@gmail.com" wrote:
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.

Apr 5 '06 #2
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'.

Apr 6 '06 #3
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.

Apr 6 '06 #4
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.

Apr 6 '06 #5
_DD
On 6 Apr 2006 09:03:57 -0700, "gr***********@gmail.com"
<gr***********@gmail.com> wrote:
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.AutoScaleBaseSize = new System.Drawing.Size(5, 13); 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.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

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.
Apr 9 '06 #6
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.

Apr 9 '06 #7
_DD
On 9 Apr 2006 09:33:03 -0700, "gr***********@gmail.com"
<gr***********@gmail.com> wrote:
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.

Apr 10 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: sathyashrayan | last post by:
Following are the selected thread from the date:30-jan-2005 to 31-jan-2005. I did not use any name because of the subject is important. You can get the original thread by typing the subject...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.