delphi TaskDialog 用法  
官方Delphi 学习QQ群: 682628230(三千人)
频道

delphi TaskDialog 用法


var
 TaskDialog: TTaskDialog;
 Button: TTaskDialogBaseButtonItem;begin
 // 在某个位置显示一个任务消息对话框
 TaskMessageDlgPos('Continue', 'Are you sure you want to continue?', mtWarning, mbYesNoCancel, 0, 10, 10);

 // 在当前位置显示另一个消息对话框
 TaskMessageDlg('Error', 'An error has occured', mtError, mbAbortRetryIgnore, 0);

 // 创建自定义任务对话框
 TaskDialog := TTaskDialog.Create(Self);
 TaskDialog.Title := 'An error has occured in the query.';
 TaskDialog.Caption := 'Query result';

 // 将 MB_OK 模态结果分配给任务对话框
 TaskDialog.ModalResult := MB_OK;

 // 向任务对话框添加一些自定义按钮
 Button := TaskDialog.Buttons.Add;
 Button.Caption := 'Continue';
 Button.ModalResult := MB_OK;

 Button := TaskDialog.Buttons.Add;
 Button.Caption := 'Retry';
 Button.ModalResult := MB_RETRYCANCEL;

// 显示对话框
 TaskDialog.Execute;




用法2:

with TTaskDialog.Create(Self) do

  try

    Caption := 'My Application';

    Title := 'Hello World!';

    Text := 'I am a TTaskDialog, that is, a wrapper for the Task Dialog introduced ' +

            'in the Microsoft Windows Vista operating system. Am I not adorable?';

    CommonButtons := [tcbClose];

    Execute;

  finally

    Free;

  end;

taskdialog1.png


更多用法:移步 https://stackoverflow.com/questions/4979556/how-to-use-the-ttaskdialog


推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.033888101577759 seconds