473,394 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Form size differs in different OS's?

I'm developing a program at home on a Windows Vista computer. In it I create
a form with a few buttons on it that fill up the form's visible area.

So, I took the application to work, where I use a Windows XP PRO computer.
When I ran my program, the form visible area is different! Not very much,
but it is obvious. I haven't done experiments yet, but it looks like the
form is slightly wider and slightly shorter. I now have extra space on the
right of my buttons as well as the bottom clipping of the bottom button.

Why is this the case? And, more to the point, is there a way of detecting
what the actually VISIBLE size is to a form when establishing its size
(Width,Height) at RUNTIME? Or is this something to do with the coordinate
system being different (e.g., one OS considers the form boundary as part of
the size/space, the other does not, or differing amountsbased on some sort
of 'style'). I guess I could just add extra space to be sure, but this
behavior seems weird to me...

[==Peter==]
Oct 23 '07 #1
2 1116
Peter Oliphant wrote:
I'm developing a program at home on a Windows Vista computer. In it I
create a form with a few buttons on it that fill up the form's
visible area.
So, I took the application to work, where I use a Windows XP PRO
computer. When I ran my program, the form visible area is different!
Not very much, but it is obvious. I haven't done experiments yet, but
it looks like the form is slightly wider and slightly shorter. I now
have extra space on the right of my buttons as well as the bottom
clipping of the bottom button.
Why is this the case? And, more to the point, is there a way of
detecting what the actually VISIBLE size is to a form when
establishing its size (Width,Height) at RUNTIME? Or is this something
to do with the coordinate system being different (e.g., one OS
considers the form boundary as part of the size/space, the other does
not, or differing amountsbased on some sort of 'style'). I guess I
could just add extra space to be sure, but this behavior seems weird
to me...
This is, most likely, due to a difference in font rendering resolution
between the two systems (e.g. one at 96dpi and one at 100dpi). This is not
at all uncommon if one of the machines is a laptop and the other not.

Yes, you can make your program adapt by setting the right properties
(particularly AutoSize and the autosize mode property) on all of the
controls, containers and forms. I can't give you a recipe from memory - I'm
sure I'd miss something, because it does take a lot of fuss to make a forms
layout that looks "the same" on different resolutions, but it can be done.

-cd
Oct 23 '07 #2
Thanks Carl! It's not too big a deal, the difference is a few pixels, so if
I just make it big enough for every case I'll be good! :)

[==Peter=]

"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:%2****************@TK2MSFTNGP02.phx.gbl...
Peter Oliphant wrote:
>I'm developing a program at home on a Windows Vista computer. In it I
create a form with a few buttons on it that fill up the form's
visible area.
So, I took the application to work, where I use a Windows XP PRO
computer. When I ran my program, the form visible area is different!
Not very much, but it is obvious. I haven't done experiments yet, but
it looks like the form is slightly wider and slightly shorter. I now
have extra space on the right of my buttons as well as the bottom
clipping of the bottom button.
Why is this the case? And, more to the point, is there a way of
detecting what the actually VISIBLE size is to a form when
establishing its size (Width,Height) at RUNTIME? Or is this something
to do with the coordinate system being different (e.g., one OS
considers the form boundary as part of the size/space, the other does
not, or differing amountsbased on some sort of 'style'). I guess I
could just add extra space to be sure, but this behavior seems weird
to me...

This is, most likely, due to a difference in font rendering resolution
between the two systems (e.g. one at 96dpi and one at 100dpi). This is
not at all uncommon if one of the machines is a laptop and the other not.

Yes, you can make your program adapt by setting the right properties
(particularly AutoSize and the autosize mode property) on all of the
controls, containers and forms. I can't give you a recipe from memory -
I'm sure I'd miss something, because it does take a lot of fuss to make a
forms layout that looks "the same" on different resolutions, but it can be
done.

-cd


Oct 23 '07 #3

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

Similar topics

5
by: WmGill | last post by:
I am experimenting with Python, and want to convert some of my PHP scripts to python cgi scripts. In PHP I use PHP_SELF for the action target. This way I can "reuse" data in fields (i.e. if the...
17
by: Sean Ross | last post by:
Hi. Recently I made a small script to do some file transferring (among other things). I wanted to monitor the progress of the file transfer, so I needed to know the size of the files I was...
6
by: User | last post by:
Anyone have ideas which os command could be used to get the size of a file without actually opening it? My intention is to write a script that identifies duplicate files with different names. I...
2
by: twan.vanberkel | last post by:
Dear all, I have a problem in difference in font size on my navigation bar. On different Windows PCs with IE5-IE6 the font size differs. At first I try to fix it to place <font> tags around the...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
16
by: Josef Dalcolmo | last post by:
I tried this on Windows only: In Python 2.4 os.path.getmtime returned the local time, in Python 2.5 it seems to return GMT: import os, time print ctime.time(os.path.getmtime(foo)) differs...
4
by: HeroOfSpielburg | last post by:
Hello, I'm very new to CSS and still in the reference/copy/paste/edit stage, so please forgive my ignorance. I'm using CSS for my blog, and while the font size is fine in Firefox, it is...
1
by: hakan.thornqvist | last post by:
I am using GZipStream for compression, and the size and contents of the compressed byte array differs from time to time, using the same source. byte uncompressed =...
158
by: jty0734 | last post by:
i don't know what input size of string is. so i can't gets inputsize before malloc function. i want determine the size of malloc without get inputsize in advance. how to deal with it?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...
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...
0
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...

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.