Delphi fmx 切换窗体最大化
2022-11-24 09:23:06 作者:admin
本文整理自网络,侵删。
unit uFormMain;
interface
uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls, FMX.Objects, FMX.Layouts, FMX.Controls.Presentation, FMX.ScrollBox, FMX.Memo;
type TfrmFormMain = class(TForm) imgTImage: TImage; lytLayoutFormMain: TLayout; lytLayoutTImage: TLayout; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; spdbtnCloseForm: TSpeedButton; Label9: TLabel; lblClickMe: TLabel; procedure imgTImageClick(Sender: TObject); procedure FormResize(Sender: TObject); procedure spdbtnCloseFormClick(Sender: TObject); private { Private declarations } public { Public declarations } end;
var frmFormMain: TfrmFormMain;
implementation
uses System.TypInfo;
{$R *.fmx}
var i: Integer;
procedure TfrmFormMain.FormResize(Sender: TObject);begin Label1.Text := Format('frmFormMain.BorderStyle = %s', [System.TypInfo.GetEnumName(System.TypeInfo(TFmxFormBorderStyle), Ord(frmFormMain.BorderStyle))]); Label2.Text := Format('frmFormMain.WindowState = %s', [System.TypInfo.GetEnumName(System.TypeInfo(TWindowState), Ord(frmFormMain.WindowState))]); Label3.Text := Format('Form.Height=%d X Form.Width=%d', [Self.Height, Self.Width]); Label4.Text := 'lytLayoutTImage.Position relative to lytLayoutFormMain'; Label5.Text := Format('lytLayoutFormMain.Height=%f X lytLayoutFormMain.Width=%f', [lytLayoutFormMain.Height, lytLayoutFormMain.Width]); Label6.Text := Format('lytLayoutTImage.Position.Y=%f X lytLayoutTImage.Position.X=%f', [lytLayoutTImage.Position.Y, lytLayoutTImage.Position.X]); Label7.Text := Format('lytLayoutTImage.Height=%f X lytLayoutTImage.Width=%f', [lytLayoutTImage.Height, lytLayoutTImage.Width]); Label8.Text := Format('lytLayoutFormMain.Width - (lytLayoutTImage.Position.X + lytLayoutTImage.Width = %f', [lytLayoutFormMain.Width - (lytLayoutTImage.Position.X + lytLayoutTImage.Width)]); Label9.Text := Format('lytLayoutTImage.Align = %s', [System.TypInfo.GetEnumName(System.TypeInfo(TAlignLayout), Ord(lytLayoutTImage.Align))]);end;
procedure TfrmFormMain.imgTImageClick(Sender: TObject);begin if frmFormMain.WindowState = TWindowState.wsMaximized then begin frmFormMain.WindowState := TWindowState.wsNormal; lblClickMe.Text := 'Click Me!'; end else begin frmFormMain.WindowState := TWindowState.wsMaximized; lblClickMe.Text := 'Click Me!'#13'Again'#13'Uh! I like...'; end;end;
procedure TfrmFormMain.spdbtnCloseFormClick(Sender: TObject);begin Close;end;
end.
相关阅读 >>
Delphi 顺序查找与二分查找
Delphi 计算文件大小
Delphi inifile to xml
Delphi parent属性的另类用法
Delphi 用nethttpclient执行post操作遇到的问题
Delphi 屏幕渐变效果的源代码
Delphi 实现文件实施监控
Delphi 制作一个内网传播的程序
Delphi中判断操作系统是否是windows7
Delphi 中 使用 tidhttp 提交post数据
更多相关阅读请进入《Delphi》频道 >>
猜你喜欢
联络方式:
400-123-789
邮箱:xiachao@163.com
Q Q:12345678
微信公众号
微信二维码