C++ Builder

La Isla Bonita



Scale a Form and all its components
Scale a Form and all its components


Description

This article shows how to scale a Form and all the components on it.

Scale_All Function

void TForm1::Scale_All( TWinControl* p, int n, int d )
{
    float Zoom = (float)n/d;
    Top = 0;
    Left = 0;
    Width  = (int) (Width * Zoom);
    Height = (int) (Height * Zoom);
    ScaleBy( n, d );
}
Homepage

Copyright © 1997-2002 Rodolfo A. Frino. All rights reserved.