unigui在 unit单元调用ShowMessage

在 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;

猜你喜欢

转载自blog.csdn.net/ozhy111/article/details/83822007
今日推荐