I developed the mcVistaSucks component which helps to solve these problems.
This page documents the results of various configurations. In theory, there are 4 important boolean (true/false) parameters, yielding 16 combinations. However, since form.AutoScroll is always false (it must be for the application to display in Vista), only 8 testcases are necessary.
I have written one totally trivial program to demonstrate the problem. (It is identical to Button3_Anchored.exe .. with only the mcVistaSucks component added.) The only difference in the various *.exe files is the setting of the parameters. The executables are located in the zip file. Basically, the forms contain 3 buttons
Basics
procedure TForm1.FormCreate(Sender: TObject); begin form1.AutoScroll := true; end; |
Examples
However, Vista is a different story. By default, the component makes the application render the same size in both XP and Vista. In fact, all the settings render the application at approximately the same size in both operating systems except when
Form1.Scaled = true mcVistaSucks1.AllowVistaScaling = true |
The automatic appearance of the scrollbars was tested for every *.exe file by manually resizing the forms. In all cases, they appear on both operating systems when mcVistaSucks1.Autoscroll is true, but not when it is false.
Note that the font in the title bar is different.
XP | Vista | Comment | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| This is the basic form without the mcVistaSucks1 component
| Button3_Anchored.exe Form1.Autoscroll = true Form1.Scaled = true mcVistaSucks1.Autoscroll = na mcVistaSucks1.AllowVistaScaling = na XP - All 3 buttons are visible Vista - The vertical scrollbar is gone, enlarging the form will not make Button 3 visible
|
| The original form with the Vista Fix (mcVistaSucks) component - default values
| Fixed_default.exe Form1.Autoscroll = false Form1.Scaled = true mcVistaSucks1.Autoscroll = true mcVistaSucks1.AllowVistaScaling = false XP - Same as without the component Vista - Almost identical to XP
|
|
| Fixed_TTT.exe Form1.Autoscroll = false Form1.Scaled = true mcVistaSucks1.Autoscroll = true mcVistaSucks1.AllowVistaScaling = true Vista - Uses Vista scaling to enlarge the form
|
|
| Fixed_TFT.exe Form1.Autoscroll = false Form1.Scaled = true mcVistaSucks1.Autoscroll = false mcVistaSucks1.AllowVistaScaling = true Vista - Uses Vista scaling to enlarge the form
|
|
| Fixed_TFF.exe Form1.Autoscroll = false Form1.Scaled = true mcVistaSucks1.Autoscroll = false mcVistaSucks1.AllowVistaScaling = false Vista - Almost identical to XP
|
|
| Fixed_FTF.exe Form1.Autoscroll = false Form1.Scaled = false mcVistaSucks1.Autoscroll = true mcVistaSucks1.AllowVistaScaling = false Vista - Almost identical to XP
|
|
| Fixed_FTT.exe Form1.Autoscroll = false Form1.Scaled = false mcVistaSucks1.Autoscroll = true mcVistaSucks1.AllowVistaScaling = true Vista - Almost identical to XP
|
|
| Fixed_FFF.exe Form1.Autoscroll = false Form1.Scaled = false mcVistaSucks1.Autoscroll = false mcVistaSucks1.AllowVistaScaling = false Vista - Almost identical to XP
|
|
| Fixed_FFT.exe Form1.Autoscroll = false Form1.Scaled = false mcVistaSucks1.Autoscroll = false mcVistaSucks1.AllowVistaScaling = true Vista - Almost identical to XP |
Comment
As a future enhancement, I might add a property that allows the component to automatically modify all the forms in a project. However, I am not sure how it would work with dynamic forms that are created as needed .. such as mcTearOff_Windows. (Actually, those already look ok .. so maybe they don't need a fix.)
I might add properties to control the title bar and menu fonts .. since they have a similar problem. However, until I modify a program that uses menus, there is no rush.
Author: Robert Clemenzi