473,800 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
9 8741
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*****@hotmai l.com.dontspam> wrote in message
news:47******** *************** ***********@mic rosoft.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
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*****@hotmai l.com.dontspam> wrote in message
news:47******** *************** ***********@mic rosoft.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
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*****@hotmai l.com.dontspam> wrote in message
news:47******** *************** ***********@mic rosoft.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
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


"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
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
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


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

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

this.AutoScaleD imensions = new
System.Drawing. SizeF(this.Curr entAutoScaleDim ensions.Width,
this.CurrentAut oScaleDimension s.Height);
this.FormBorder Style = this.AutoSize = false;
System.Windows. Forms.FormBorde rStyle.FixedSin gle;


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

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

Similar topics

1
1637
by: Bryan | last post by:
I have this function below function checkLength(field, nextField) { var letters = document.form1.elements.value.length +1; if (letters <= 2) {document.form1.elements.focus()} else {document.form1.elements.focus()} }
1
2346
by: Roger | last post by:
Hi All, I have an app where I change the size of the form at run time using controls and I do not want the user to be able to resize the form, I have removed the min and max buttons. I have tried to set the min and max size to what I want but now the form will not resize when they should be, it looks like I could change the min and max size everytime I want to resize the form but this seems a little cumbersome - - any easy way of doing...
1
1957
by: Rodrigo Ferreira | last post by:
In my project i create a form in runtime when i click in a button. The problem consists in the form size. I put this lines: frmCalculadora.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; frmCalculadora.AutoScaleBaseSize = new System.Drawing.Size(5, 13); frmCalculadora.ClientSize = new System.Drawing.Size(160, 16); But the form doesn't appear with this height. The width is correct but the height not!
4
1922
by: Woody Splawn | last post by:
I don't mean to be too wordy but if you will indulge me a moment I need to get something clear in my mind. I am concerned about the size of my forms. I am concerned that if I put too much code in them they may run slow. These are winforms, nothing to do with the net. In the enviroment I came from (PowerBuilder) if your form got too big because of code, you just shuffled off some of it into what VS thinks of as a module. I will do the...
14
3434
by: Galen Somerville | last post by:
My current screen resolution is set to 1024 x 768. My form size always comes up as 1032 x 748. I have tried the help sample ' Retrieve the working rectangle from the Screen class ' using the PrimaryScreen and the WorkingArea properties. Dim workingRectangle As System.Drawing.Rectangle = _ Screen.PrimaryScreen.WorkingArea ' Set the size of the form slightly less than size of
7
2325
by: greg.merideth | last post by:
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...
3
2011
by: linux_bp | last post by:
I had deleted my object files accidently. Now to analyse a core i need object files. If I recompile the same source code with imake on solaris, i m getting the binary of different size. Is it because of different compilation date and time?
2
1745
by: =?Utf-8?B?VGVycnk=?= | last post by:
Hope someone has some ideas - this is driving me nuts, I am using VS2008 and have a tightly layed out form at 8 pts. The form has a font dialog and when the user changes the font size, everything works great. I go through the forms control collection (recurively) and everything resizes as it should. Ok, so the next step is to remember the font size selected by the user and select it when the form is loaded. Woops - does not work! So, I...
0
1941
by: madasamonkey | last post by:
I'm using Visual Studio 2008. The o/s is Win XP Pro. Here's my problem: The machine I'm working on is a PC and the monitor resolution is 1280 x 1024 The target machine on which the app will run is a media centre PC hooked up to a 42inch LCD display, on which the screen res is 1360 x 768. I want the form to fill the entire TV screen, but my attempts to increase the form size to do this are thwarted by Visual Studio. Each time I try to set...
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10274
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10251
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.