可是panel上面的控件就不行了,每个panel上面都有好多别的控件,那怎么办?

解决方案 »

  1.   

    //全部答了
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, Buttons;type
      TForm1 = class(TForm)
        Button1: TButton;
        SpeedButton1: TSpeedButton;
        procedure FormResize(Sender: TObject);
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
        FWidth: Integer;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormResize(Sender: TObject);
    begin
      ScaleBy(Width, FWidth);
      FWidth := Width;
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin
      FWidth := Width;
    end;end.