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.

  • 相关阅读:
    swift
    swift
    swift
    swift
    swift
    swift
    swift
    选择排序
    组合 和 继承
    Android中使用LitePal操控SQLite数据库
  • 原文地址:https://www.cnblogs.com/feng801/p/1305719.html
Copyright © 2011-2022 走看看