在 unit单元调用ShowMessage
units Vcl.Controls,uniGUIDialogs
procedure CustomShowMessage(pMsg: string; pSender: TWinControl = nil);
procedure CustomSetFocus(Sender: TComponent; Res: Integer); // focus control
procedure CustomShowMessage(pMsg: string; pSender: TWinControl = nil);
begin
if pSender <> nil then
begin
F_ActiveControl := pSender;
end;
ShowMessage(pMsg,CustomSetFocus);
end;
procedure CustomSetFocus(Sender: TComponent; Res: Integer); // focus control
begin
if F_ActiveControl <> nil then
begin
F_ActiveControl.SetFocus;
end;
end;