您的位置:首页 > 其它

注意、提示、错误通用对话框函数

2007-09-24 09:02 323 查看
procedure CreateError(const Msg: string; Sender: TWinControl;
  ico: smallint);
var
  flag: LongInt;
  Info: string;
begin
  case ico of
    1:
      begin
        flag := MB_OK + MB_ICONWARNING;
        Info := '注意';
      end;
    2:
      begin
        flag := MB_OK + MB_ICONERROR;
        Info := '错误';
      end
  else
    begin
      flag := MB_OK + MB_ICONINFORMATION;
      Info := '提示';
    end;
  end;
  if (Sender <> nil) and (Sender.Visible) and (Sender.Enabled) then
    Sender.SetFocus;
  MessageBox(Screen.ActiveForm.Handle, PChar(Msg), PChar(Info), flag +
    MB_APPLMODAL);
  Abort;
end; 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  string
相关文章推荐