码迷,mamicode.com
首页 > 其他好文 > 详细

messagebox在最顶层写法

时间:2016-12-20 20:23:29      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:can   ati   lap   sage   message   mod   self   windows   use   



MessageBox(Application.Handle, ‘text‘, ‘caption‘, MB_TOPMOST + MB_ICONINFORMATION);)

或者

MessageBox(Self.Handle, ‘text‘, ‘caption‘, MB_TOPMOST + MB_ICONINFORMATION);)

或者

Application.MessageBox(‘text‘, ‘caption‘, MB_TOPMOST + MB_ICONINFORMATION);)

 unit 打开文件目录;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs,ShellAPI, Vcl.StdCtrls;

type
  TForm2 = class(TForm)
    btn1: TButton;
    btn2: TButton;
    btn3: TButton;
    btn4: TButton;
    btn5: TButton;
    btn6: TButton;
    btn7: TButton;
    btn8: TButton;
    btn9: TButton;
    btn10: TButton;
    btn11: TButton;
    btn12: TButton;
    procedure btn1Click(Sender: TObject);
    procedure btn2Click(Sender: TObject);
    procedure btn3Click(Sender: TObject);
    procedure btn4Click(Sender: TObject);
    procedure btn5Click(Sender: TObject);
    procedure btn6Click(Sender: TObject);
    procedure btn7Click(Sender: TObject);
    procedure btn8Click(Sender: TObject);
    procedure btn9Click(Sender: TObject);
    procedure btn10Click(Sender: TObject);
    procedure btn11Click(Sender: TObject);
    procedure btn12Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}
procedure TForm2.btn4Click(Sender: TObject);
begin
messagebox(0,没有选择播放类型,错误,MB_ICONINFORMATION+MB_OkCancel );
end;

procedure TForm2.btn5Click(Sender: TObject);
begin
Application.MessageBox(MessageBox,警告,MB_ICONWARNING+MB_YesNo);
end;

procedure TForm2.btn6Click(Sender: TObject);
var
a:string;
begin
MessageBox(Form2.Handle,MessageBox,提示,MB_ICONINFORMATION+MB_OkCancel);
end;

procedure TForm2.btn7Click(Sender: TObject);
begin
MessageBox(Form2.Handle,MessageBox,提示,MB_ICONINFORMATION+MB_OkCancel+MB_DEFBUTTON2+MB_APPLMODAL);
end;

end.

 

messagebox在最顶层写法

标签:can   ati   lap   sage   message   mod   self   windows   use   

原文地址:http://www.cnblogs.com/chuangyiyuan/p/6203775.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!