zoukankan      html  css  js  c++  java
  • 控制控件随窗体变化代码

    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.

  • 相关阅读:
    Django部分面试题目
    网编部分
    面试题
    mysql安装
    并发编程
    集合以及深浅拷贝和和小数据池--个人一些经验总结
    稍微比较全的那种字典
    个人声明
    python
    python-pdf文件(持续更新
  • 原文地址:https://www.cnblogs.com/feng801/p/1305719.html
Copyright © 2011-2022 走看看