• TScreen 类 程序中窗体的个数


    //一个包含两个窗体的例子, 这是工程中的内容:
    program Project1;
    
    uses
      Forms,
      Unit1 in 'Unit1.pas' {Form1},
      Unit2 in 'Unit2.pas' {Form2};
    
    {$R *.res}
    
    begin
      Application.Initialize;
      Application.MainFormOnTaskbar := True;
      Application.CreateForm(TForm1, Form1);
      Application.CreateForm(TForm2, Form2);
      Application.Run;
    end.
    
    // unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} uses Unit2; procedure TForm1.Button1Click(Sender: TObject); var num: Integer; begin num := Screen.FormCount; {当前程序中窗体的个数} ShowMessage(IntToStr(num)); {2} Screen.Forms[1].ShowModal; {显示第二个窗体} {上面这句相当于} //Form2.ShowModal; end; end.
  • 相关阅读:
    html5文件api
    折腾一个自己的UrlRewrite
    hdu 4218 ( IMBA? )
    hdu 4217 Data Structure
    九度OJ 1008
    倒酒趣题详解
    第三届蓝桥杯复赛原题
    第三届蓝桥杯复赛题解析
    hdu 4223 Dynamic Programming
    hdu 4224 Enumeration
  • 原文地址:https://www.cnblogs.com/del/p/1048576.html
Copyright © 2020-2023  润新知