By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,486 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

Different Form Size on different PCs (What can i DO????)

P: n/a
I've created a program in C#, which includes several Forms. some of the forms
are in different size, but i start all of them in Window Normal Size.
I took the exe file from the \bin\debug library and started it on my
computer and all the forms where at the same size as i programed it to be.
then i took it to my friend's PC and it worked fine too (we both have NVIDIA
display card), then i took it to another computer (with different display
card) and there the form where not at the same size as i programmed. Some
were too big (came out of the screen's border). Is it possible that different
display cards make the forms to be displayed differntly? I asked some
friends, and they told me that C# suppose to know how to handle such things
automaticly.
What can I do, to fix this problem? because i want to put my program on
several PCs and i don't know which display card they'll have.

Thanks,
Gidi.
Dec 4 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
The size of a window is measured in pixels. Different computers have
different screen resolutions. You would need to get the pixel size of the
screen and resize the form accordingly in order to do this.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

"Gidi" <sh*****@hotmail.com.dontspam> wrote in message
news:47**********************************@microsof t.com...
I've created a program in C#, which includes several Forms. some of the
forms
are in different size, but i start all of them in Window Normal Size.
I took the exe file from the \bin\debug library and started it on my
computer and all the forms where at the same size as i programed it to be.
then i took it to my friend's PC and it worked fine too (we both have
NVIDIA
display card), then i took it to another computer (with different display
card) and there the form where not at the same size as i programmed. Some
were too big (came out of the screen's border). Is it possible that
different
display cards make the forms to be displayed differntly? I asked some
friends, and they told me that C# suppose to know how to handle such
things
automaticly.
What can I do, to fix this problem? because i want to put my program on
several PCs and i don't know which display card they'll have.

Thanks,
Gidi.

Dec 4 '05 #2

P: n/a
thanks Kevin,
even when i changed the resolution of the problematic screen to same as
mine, it still didn't work well.

"Kevin Spencer" wrote:
The size of a window is measured in pixels. Different computers have
different screen resolutions. You would need to get the pixel size of the
screen and resize the form accordingly in order to do this.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

"Gidi" <sh*****@hotmail.com.dontspam> wrote in message
news:47**********************************@microsof t.com...
I've created a program in C#, which includes several Forms. some of the
forms
are in different size, but i start all of them in Window Normal Size.
I took the exe file from the \bin\debug library and started it on my
computer and all the forms where at the same size as i programed it to be.
then i took it to my friend's PC and it worked fine too (we both have
NVIDIA
display card), then i took it to another computer (with different display
card) and there the form where not at the same size as i programmed. Some
were too big (came out of the screen's border). Is it possible that
different
display cards make the forms to be displayed differntly? I asked some
friends, and they told me that C# suppose to know how to handle such
things
automaticly.
What can I do, to fix this problem? because i want to put my program on
several PCs and i don't know which display card they'll have.

Thanks,
Gidi.


Dec 4 '05 #3

P: n/a
This might be overkill, but I set the Dock property to most of the controls
on my form. In my opinion, it is much more dynamic, flexible, and automated
than trying to handle resize events. Usually, I dock everything to the top
and/or bottom of a form and set the app's main workspace to Fill. If I don't
want a control, like a button or textbox, to stretch the entire width of
the control, I group these controls in Panels and set Panel.Dock. In my opinion,
docking is much more powerful than Anchor because it ensures that controls
stay adjacent to other controls.

You should also play with .NET 2.0 flow layout panel.
thanks Kevin,
even when i changed the resolution of the problematic screen to same
as
mine, it still didn't work well.
"Kevin Spencer" wrote:
The size of a window is measured in pixels. Different computers have
different screen resolutions. You would need to get the pixel size of
the screen and resize the form accordingly in order to do this.

-- HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
"Gidi" <sh*****@hotmail.com.dontspam> wrote in message
news:47**********************************@microsof t.com...
I've created a program in C#, which includes several Forms. some of
the
forms
are in different size, but i start all of them in Window Normal
Size.
I took the exe file from the \bin\debug library and started it on my
computer and all the forms where at the same size as i programed it
to be.
then i took it to my friend's PC and it worked fine too (we both
have
NVIDIA
display card), then i took it to another computer (with different
display
card) and there the form where not at the same size as i programmed.
Some
were too big (came out of the screen's border). Is it possible that
different
display cards make the forms to be displayed differntly? I asked
some
friends, and they told me that C# suppose to know how to handle such
things
automaticly.
What can I do, to fix this problem? because i want to put my program
on
several PCs and i don't know which display card they'll have.
Thanks,
Gidi.

Dec 4 '05 #4

P: n/a
Probably your friend increased the font size in his appearnce settings
of the desktop, that has sometimes weird effects on statically designed
windows as buttons become too small and so forth.

Dec 4 '05 #5

P: n/a


"jo*******@gmx.de" wrote:
Probably your friend increased the font size in his appearnce settings
of the desktop, that has sometimes weird effects on statically designed
windows as buttons become too small and so forth.


I just tried this. The forms title bar grew, but the other controls (label,
button, checkbox) were completely unaffected. The title bar grew "up" so it
didn't cause problems by pushing controls down off the bottom of the form
either.
Dec 5 '05 #6

P: n/a
Dan Neely wrote:

"jo*******@gmx.de" wrote:
Probably your friend increased the font size in his appearnce settings
of the desktop, that has sometimes weird effects on statically designed
windows as buttons become too small and so forth.


I just tried this. The forms title bar grew, but the other controls (label,
button, checkbox) were completely unaffected. The title bar grew "up" so it
didn't cause problems by pushing controls down off the bottom of the form
either.


Do not change the font size in appearance settings, instead go to
Settings->Advanced and change DPI Setting. This is the setting that has
weird consequences for values other than 96.

Also see the documentation for the AutoScale (1.1) and AutoScaleMode
(2.0) properties.

HTH,
Stefan
Dec 6 '05 #7

P: n/a
Thanks Stefan,

I changed the DPI and it fixed the problem.

"Stefan Simek" wrote:
Dan Neely wrote:

"jo*******@gmx.de" wrote:
Probably your friend increased the font size in his appearnce settings
of the desktop, that has sometimes weird effects on statically designed
windows as buttons become too small and so forth.


I just tried this. The forms title bar grew, but the other controls (label,
button, checkbox) were completely unaffected. The title bar grew "up" so it
didn't cause problems by pushing controls down off the bottom of the form
either.


Do not change the font size in appearance settings, instead go to
Settings->Advanced and change DPI Setting. This is the setting that has
weird consequences for values other than 96.

Also see the documentation for the AutoScale (1.1) and AutoScaleMode
(2.0) properties.

HTH,
Stefan

Dec 11 '05 #8

P: n/a


How to read the DPI setting programatically from VB.Net code?

*** Sent via Developersdex http://www.developersdex.com ***
Sep 28 '06 #9

P: n/a
Try this code

this.AutoScaleDimensions = new
System.Drawing.SizeF(this.CurrentAutoScaleDimensio ns.Width,
this.CurrentAutoScaleDimensions.Height);
this.FormBorderStyle = this.AutoSize = false;
System.Windows.Forms.FormBorderStyle.FixedSingle;


*** Sent via Developersdex http://www.developersdex.com ***
Oct 3 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.