Hi all.
I have created a program that runs fine on desktop computers but when it is run on laptops the forms do something weird and the user now has to scroll them to see the full screen.
the first form I display is only 400 x 200 pixels but no matter what resolution the laptop is set to the user has to scroll, even if its 1400 x 1080 resolution and the form is small in the center of the screen - without having a need (technically) to scroll.
Can anyone suggest a solution to this? I've never come across this before.
I've hit it recently, working in WinXP on some code that was developed on Win2K. For the most part the forms are ok, except where I used Anchors to pin controls to the right and/or bottom of the form. The problem turned out to be that the window framing is quite different on XP (using the default settings) than on Win2K, NT4, 98, etc. and the form stores the width and height of the form itself, not the client area.
The core of the problem is that the relationship between form size and client area is variable not just between versions of windows, but between different appearance settings and themes on the same version. On Win98 you can mess it up by changing the size of the title bar, etc.
The solution for me, after much messing around, was to stop using the Anchors property to position controls. Using aligned panels gave (mostly) the same effect, with some OnResize code to fix the rest.
You might get away with using the form's BorderWidth and AutoSize properties to resize the form to fit the controls at runtime - in the form's OnShow method, toggle AutoSize on and off to have the form resize itself.
-- Corey Murtagh The Electric Monk "Quidquid latine dictum sit, altum viditur!"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
