BUG: WinForm designer in C#...


A

anonymouse

We have a number of machiens with VS.NET 2003 installed and on every
machine, the forms in the designer are comming out different sizes and when
we build and run the app (without code changes) they appear different on
every machine. Why? We disabled auto scaling of fonts we locked the form
yet nothing helps.

Any ideas why this is happening and how to fix it?
 
Ad

Advertisements

K

Keith Patrick

This is kinda a dumb question, but are all your machines running at the same
video resolution?
Maybe check InitializeComponent() to ensure the window size is being set.
 
A

anonymouse

Its causing problems on the code checkins also, its somehow resizing the
form. when I build its appearing different on others machines. I was told
its a known problem.
 
H

Herfried K. Wagner [MVP]

* "anonymouse said:
Its causing problems on the code checkins also, its somehow resizing the
form. when I build its appearing different on others machines. I was told
its a known problem.
The problem can occur if the form is edited on computers with different
number of dpis. VS.NET will change the form's code automatically...
 
A

anonymouse

Ok, how can i disable this as its causing havoc in a developement
environment between laptops, desktops XP, 2000 etc.

Its literally causing havoc on checkins .
 
A

anonymouse

This happens even if the form .Locked design property is = true. I see this
as a BUG nothing more nothing less than a badly designed feature.

There is no benifit to this, its a problem maker. We even set .AutoScale =
false , doesnt help.

This is a dumbass feature. If we set the size, it should stay at that size,
not whilly nilly resize itself. This has got to rank as one of the most
stupidest features Ive ever seen.


anonymouse said:
Ok, how can i disable this as its causing havoc in a developement
environment between laptops, desktops XP, 2000 etc.

Its literally causing havoc on checkins .
 
Ad

Advertisements

J

Joe White

Instead of saying "it changes things", could you post snippets of the exact
lines of InitializeComponent() that are getting changed, and show us a
"before" and "after" on those lines? I might be able to make suggestions if
I knew what the problem was. (Or I might not -- there's always that
possibility too.)

Also, does the problem occur only when the file was last checked in by a
Win2k-based developer and is then opened by a WinXP-based developer (or vice
versa)? Or does it occur even if the file was last modified on one Win2k
machine and is later checked out on another Win2k machine?
 
A

anonymouse

Ill make a diff of the .cs file when I get back to the machines.
 
A

anonymouse

Whats I saw also happening on one machine was the form becomming wider then
after a few restarts it was back to normal. Odd behaviour indeed.

Thats the basic reason I hate wizards n designers, I just dont have faith in
them.

anonymouse said:
Ill make a diff of the .cs file when I get back to the machines.



Joe White said:
Instead of saying "it changes things", could you post snippets of the exact
lines of InitializeComponent() that are getting changed, and show us a
"before" and "after" on those lines? I might be able to make
suggestions
 
H

Herfried K. Wagner [MVP]

* "Joe White said:
Instead of saying "it changes things", could you post snippets of the exact
lines of InitializeComponent() that are getting changed, and show us a
"before" and "after" on those lines? I might be able to make suggestions if
I knew what the problem was. (Or I might not -- there's always that
possibility too.)

Also, does the problem occur only when the file was last checked in by a
Win2k-based developer and is then opened by a WinXP-based developer (or vice
versa)? Or does it occur even if the file was last modified on one Win2k
machine and is later checked out on another Win2k machine?
The designer will change the 'AutoScaleBaseSize' property when opening
the project on a machine with different number of dpis (in VS.NET 2002).
 
A

anonymouse

hmm thats a designer only property? SO i can set this to false right?
 
Ad

Advertisements

A

anonymouse

But I set .AutoScale = FALSE in the designer, so surely that property wont
be used?
 
J

Joe White

I suspect that AutoScaleBaseSize is ignored *at runtime* if AutoScale is
false, but that *at design time* it's written to InitializeComponent()
regardless of the AutoScale setting. This would make some sense, as it
would make sure things would work correctly in case you later decided to
change AutoScale back to true.

But wouldn't AutoScaleBaseSize only change if some of your developers are
running in Large Fonts mode and others are not? I would think you'd have
noticed already if that was the case -- if different developers are running
different dpis, then of course you'd have lots of diffs every time you check
in.

Again, it would be helpful to know exactly what's changing when you check in
from different machines. Otherwise, we're just guessing.
 
H

Herfried K. Wagner [MVP]

* "Joe White said:
But wouldn't AutoScaleBaseSize only change if some of your developers are
running in Large Fonts mode and others are not? I would think you'd have
noticed already if that was the case -- if different developers are running
different dpis, then of course you'd have lots of diffs every time you check
in.
That's the problem. If one developer works on a notebook with large
fonts enabled, the forms will show wrong on a normal pc with normal fonts.
 
J

Joe White

That's the problem. If one developer works on a notebook with large
fonts enabled, the forms will show wrong on a normal pc with normal fonts.
Theoretically, if your app is designed to support scaling at all, it should
work perfectly. If you can't handle designing in large fonts and running in
small fonts, then you certainly couldn't handle the probably-more-common
case of developing in small fonts and running in large. But if you *can*
handle scaling (going both ways), then you would see a lot of diffs when
going from a small-fonts development PC to a large-fonts one, but no actual
change in runtime behavior. Theoretically.

But I know very little about .NET's form-scaling features, so I couldn't
even begin to guess what settings it would take to make it work this way.
Maybe the default settings take care of it; I don't know.
 
B

bug

So, any suggestions on how to solve this?

Its causing problems this "feature". Never seen this on
before on any designer.


Its definately a problem maker rather than a problem
solver for us.

How can we override this behaviour because .AutoScale =
false sure isnt doing it or rather, its a half assed
solution because its only affecting runtime and not design
time.
 
Ad

Advertisements

B

BUG

Ok I have the form in front of me, the form is LOCKED in
design time, the autoscale = false and I did a diff after
a build and closing VS.NET I get NO DIFFERENCES!!
probably because the form is locked, but when I build it,
the form is obviously wider if I compare them, its so much
wider, its unbelievable and when I run this exe on other
machines, its nuffed and way off size.

Its a real pain in the gonads. What would be the best way
to handle this "feature" because we need a fixed form size
and obviously we are not getting this in .NET.
 
G

Guest

If large fonts isnt enabled on the laptop

Could it be the slight differences in the fonts on diff
installs?

Microsoft Sans Serif, 8.25pt is what I have currently as
the default which I presume is standard on most VS.NET
installs.

Problems problems problems with this feature, my guess is
MS had everybody use the same GHOST image for testers and
they never seen this issue. It maybe classed as a
feature, but forus its a freakure. Doesnt work in my view
plain and simple.
 
J

Joe White

If large fonts isnt enabled on the laptop
Could it be the slight differences in the fonts on diff
installs?

Microsoft Sans Serif, 8.25pt is what I have currently as
the default which I presume is standard on most VS.NET
installs.
That font setting is saved as part of the form, so different computers
shouldn't be changing it. But again, until the OP posts the diffs, there's
no way to tell what's causing the problem.
 
Ad

Advertisements

N

news.microsoft.com

AutoScaleBaseSize which is slightly different. This is changing on
different machines and rendering the designer useless for us.
 

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