同意Kingron(WinAPI)的方法, 我这有个函数,自己定义的,程序里经常用的 function ShowMessage(const Msg:string;MsgType:MessageType):integer; var head,mssg:array[0..100] of char; mb:word; begin mb:=0; if MsgType=msgWarn then begin head:='警告'; mb:=MB_OK or MB_ICONWARNING; end; if MsgType=msgError then begin head:='错误'; mb:=MB_OK or MB_ICONERROR; end; if MsgType=msgInfo then begin head:='信息'; mb:=MB_OK or MB_ICONINFORMATION; end; StrPCopy(Mssg,msg); Result:=Application.MessageBox(mssg,head,mb); end; 另外你还可以增加,自己定义的
不想用API,也可以修改:
用Ctrl+Click跟踪Showmessage的源代码,然后把他们Copy下来,自己做一个函数即可。
寄人篱下,苦啊!!!!
MessageBox不是VC里的吗?算了.
自己到Code Insight中定义一个模版:
msgbox=MessageBox(handle,'|','',MB_OK+MB_ICONINFORMATION);
以后在编写程序的时候,需要显示信息的时候,输入msgbox,然后按Ctrl+j就可以了,只要填入标题和提示即可。
或用:
application.messagebox('提示内容','标题',mb_iconwarning+mb_ok);
我这有个函数,自己定义的,程序里经常用的
function ShowMessage(const Msg:string;MsgType:MessageType):integer;
var head,mssg:array[0..100] of char;
mb:word;
begin
mb:=0;
if MsgType=msgWarn then
begin
head:='警告';
mb:=MB_OK or MB_ICONWARNING;
end;
if MsgType=msgError then
begin
head:='错误';
mb:=MB_OK or MB_ICONERROR;
end;
if MsgType=msgInfo then
begin
head:='信息';
mb:=MB_OK or MB_ICONINFORMATION;
end;
StrPCopy(Mssg,msg);
Result:=Application.MessageBox(mssg,head,mb);
end;
另外你还可以增加,自己定义的
高高高!!!!!!!!!!!!!!!!!!!!
以后我就用application.messagebox了.