Sign in Join
Wiki copytemporary

TTaskDialog/zh CN

English · Français · Suomi · Русский · 中文(中国)

TTaskDialog 是不可见控件, 运行时会显示完整的对话框, 具有 Windows TaskDialog API 的功能. 在 Dialogs tab 的 Component Palette. Lazarus 1.8以后包含此控件.

调用方法:Execute(), 假如获得 True, 属性 ModalResult 具有如下:

假如窗口成功打开则返回True. 对话框无法为不同参数显示对话框, 这种情况下就不执行,则返回False.

属性 MainIcon 可以设置弹窗对应的图标 : none, warning, error, information, shield.

属性 RadioButton 有单选按钮对象。

样例

This example shows how to create dialog in runtime, and to add custom buttons in runtime:

pascal
  with TTaskDialog.Create(self) do
    try
      Title := 'Confirm removal';
      Caption := 'Confirm';
      Text := 'Remove selected item?';
      CommonButtons := [];
      with TTaskDialogButtonItem(Buttons.Add) do
      begin
        Caption := 'Remove';
        ModalResult := mrYes;
      end;
      with TTaskDialogButtonItem(Buttons.Add) do
      begin
        Caption := 'Keep';
        ModalResult := mrNo;
      end;
      MainIcon := tdiQuestion;
      if Execute then
        if ModalResult = mrYes then
          ShowMessage('Item removed');
    finally
      Free;
    end

参考资料


From the Free Pascal wiki, page "TTaskDialog/zh CN", as it stood on 2020-05-03 after a change by TyphonFinger, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Edited on wiki.freepascal.org by 1 person, 2020

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
TyphonFingerCreated page

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.