概述
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.
转载于:https://www.cnblogs.com/chuangyiyuan/p/6203775.html
最后
以上就是可靠胡萝卜为你收集整理的messagebox在最顶层写法的全部内容,希望文章能够帮你解决messagebox在最顶层写法所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复