zoukankan      html  css  js  c++  java
  • 演示 Rect、Bounds 生成 TRect 的区别

    本例效果图:

    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, ExtCtrls;
    
    type
      TForm1 = class(TForm)
        Button1: TButton;
        RadioGroup1: TRadioGroup;
        procedure RadioGroup1Click(Sender: TObject);
        procedure FormCreate(Sender: TObject);
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    var
      R: TRect;
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      RadioGroup1.Items.CommaText := 'Undo,Rect,Bounds';
      R := Button1.BoundsRect;
    end;
    
    procedure TForm1.RadioGroup1Click(Sender: TObject);
    begin
      case RadioGroup1.ItemIndex of
        0: Button1.BoundsRect := R;
        1: Button1.BoundsRect := Rect(50,50,100,80);  {参数3、4 是一个点}
        2: Button1.BoundsRect := Bounds(50,50,100,80);{参数3、4 分别是宽度与高度}
      end;
    end;
    
    end.
    好的代码像粥一样,都是用时间熬出来的
  • 相关阅读:
    11.tp5常见漏洞
    10.tp3常见漏洞
    1.linux分析排查
    3.docker镜像探究
    1.docker概述
    4.docker常用命令
    2.docker安装
    3.windows分析排查
    9.thinkphp框架模型
    2.win2k8搭建asp网站
  • 原文地址:https://www.cnblogs.com/jijm123/p/14193168.html
Copyright © 2011-2022 走看看