Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form size different in different Windows OS 2

Status
Not open for further replies.

JerryAttrick

Technical User
May 14, 2005
23
0
0
NZ
I’ve completed a Delphi project whilst using a desktop running XP. When I run the 'exe' file on a Win98 Laptop the form size and components come out slightly different sizes, thus allowing a peep at the edge of text intended to be hidden at that stage. Can I combat these subtle changes?

Within Delphi can I ‘detect’ which OS my program runs in order to make alterations accordingly?

Do I have to seek out people running different OS’s to check what will happen in each case in order to make allowances?

Why is life so complicated?!
 
In the FAQ forum, Clive ,aka Stretchwickster, has posted a solution for your 2[sup]nd[/sup] question.

Steven
 
Here's the link:
How do I determine the Windows OS version? (faq102-3232)

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 

Can I combat these subtle changes?

You may find it useful to set "TForm.ClientHeight" property to the desired ClientHeight on OnCreate event of your form. (e.g. in your case the height of your form would probably be equal to the top coordinate of the label which is supposed to "be hidden").

Code:
procedure TForm1.FormCreate(Sender: TObject);
begin
    //Make sure clientheight is set as desired 
    ClientHeight:=Label1.Top+Label1.Height;
end;

The subtle changes you describe are due to the fact that on different machines the window frame settings maybe different. For example the Frame caption height maybe set to different value or the frame edge width maybe different.

Do I have to seek out people running different OS’s to check what will happen in each case in order to make allowances?

You dont have to. In fact even if you do, still you havent really solved your problem since those subtle changes in depend on the version of windows operating system but rather on the Frame window settings. As an example try changing "Appearance" of your Window frames from "XP" to "classic style" and see how your program behaves even in same operating system.


Why is life so complicated?!

I love this question.




P.S.
I have to mention here that everything written here is credit of my work colegue Phil, who had so many things to say in relation to this problem. Unfortunately or maybe fortunately :) i only remembered the above.

If you are curious see also the help for GetSystemMetrics windows function on MSDN help.




"It is in our collective behaviour that we are most mysterious" Lewis Thomas
 
me again :)

I noticed a typing error on my previous post and I felt like I should make my point clear.

...those subtle changes DO NOT depend on the version of windows operating system but rather on the Frame window settings. As an example try changing "Appearance" of your Window frames from "XP" to "classic style" and see how changing window frames can affect your program windows even in same operating system...
 
Some guidelines I use:

1) Target your forms for the lowest screen resolution in use by your users. This is probably VGA resolution, I prefer 800x600. Switch your monitor to the desired resolution. Forms you develop at resolutions too high for VGA to display probably will be clipped to fit.

2) Use consistent font sizes in an app's form. Build all forms on a system with 96 dpi small fonts, or all on a system with 120 dpi large fonts, but don't mix the two in the same application.
Also, forms tend to scale better up then down, so building fonts with 96 dpi will give slightly better results on user systems with large fonts installed than the other way around.

3)If you want to use form scaling, set the forms AutoScroll property to False

Steven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top