zoukankan      html  css  js  c++  java
  • firemonkey-学习2

    Form的name属性在运行时可能会改变。比如说TForm1创建了3个,则实际name属性为Form1,Form1_1,Form1_2. 实际也可能是其它名字。猜想名字可能是全局唯一的。

    可以选择新的模态窗口显示方式:这种方式显示的实际不是模态的。只是匿名过程的一个使用。

    TCommonCustomForm = class

        function ShowModal: TModalResult; overload;
        procedure ShowModal(const ResultProc: TProc<TModalResult>); overload;

    end.

    procedure MyCurrentForm.MyButtonClick(Sender: TObject);
    var
      dlg: TMyModalForm;
    begin
      // Create an instance of a form.
      dlg := TMyModalForm.Create(nil);
     
      // Configure the form. For example, give it a display name.
      dlg.Caption := 'My Modal Dialog Box';
     
      // Show your dialog box and provide an anonymous method that handles the closing of your dialog box.
      dlg.ShowModal(
        procedure(ModalResult: TModalResult)
        begin
          // Do something.
        end
      );
    end;

    不过窗口并不会自动销毁。如果需要自动销毁。可以如下这样做:
    procedure TMyModalForm.FormClose(Sender: TObject; var Action: TCloseAction);
    begin
      Action := TCloseAction.caFree;
    end;
  • 相关阅读:
    pytest常用命令行
    pytest中一些常用插件
    case运行失败进行重试-pytest-rerunfailures插件
    adb 在自动化测试中的截图
    app的冷启动和热启动
    ATX
    UI自动化中常用的三种等待
    allure
    性能指标分析
    接口自动化之接口依赖解决
  • 原文地址:https://www.cnblogs.com/khzide/p/4433252.html
Copyright © 2011-2022 走看看