有个缺点,就是窗口缩放的时候要保证高宽比例.不然会乱. Delphi syntax:procedure ScaleBy(M, D: Integer);C++ syntax:void __fastcall ScaleBy(int M, int D);DescriptionScaleBy resizes a control without moving its upper left corner. This is similar to changing the Height and Width properties, but the control also attempts to rescale and rearrange any child controls to maintain their relative size and placement.The M and D parameters define a multiplier and divisor by which to scale the control. For example, to make a control 75% of its original size, specify the value of M as 75, and the value of D as 100. Any pair of values that has the same ratio has the same effect. Thus M = 3 and D = 4 also makes the control 75% of its previous size.To rescale the control抯 children without rescaling the control itself, use ScaleControls.
Delphi syntax:procedure ScaleBy(M, D: Integer);C++ syntax:void __fastcall ScaleBy(int M, int D);DescriptionScaleBy resizes a control without moving its upper left corner. This is similar to changing the Height and Width properties, but the control also attempts to rescale and rearrange any child controls to maintain their relative size and placement.The M and D parameters define a multiplier and divisor by which to scale the control. For example, to make a control 75% of its original size, specify the value of M as 75, and the value of D as 100. Any pair of values that has the same ratio has the same effect. Thus M = 3 and D = 4 also makes the control 75% of its previous size.To rescale the control抯 children without rescaling the control itself, use ScaleControls.
比如:
edit.width:=form.width*0.85;