黑白程式

黑白程式

导航

控制控件随窗体变化代码

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    mmo1: TMemo;
    procedure FormResize(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  FormOldWid:Integer ;//保存原来的窗体宽度
implementation

{$R *.dfm}

procedure TForm1.FormResize(Sender: TObject);
begin
if   FormOldWid>0 then
 begin
   ScaleBy(self.Width,FormOldWid);//起作用的主要函数
   FormOldWid:=self.Width;
 end;

end;

procedure TForm1.FormShow(Sender: TObject);
begin
showmessage(inttostr(self.Width));
FormOldWid:=self.Width;//保存初始窗体宽度。
end;

end.

posted on 2008-10-07 17:23  黑白程式  阅读(176)  评论(0编辑  收藏  举报