Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
function TForm1.MyMessageDlg(const ACaption: string;
const Msg: string;
DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons;
DefButton: Integer;
HelpCtx: Longint): Integer;
var
i: Integer;
button: TButton;
begin
with CreateMessageDialog(Msg, DlgType, Buttons) do
try
Caption := ACaption;
HelpContext := HelpCtx;
for i := 0 to ComponentCount - 1 do
begin
if (Components[i] is TButton) then
begin
button := TButton(Components[i]);
button.default := button.ModalResult = DefButton;
if button.default then
ActiveControl := button;
end;
end;
Result := ShowModal;
finally
Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if MyMessageDlg('Message Title', 'Message Content',
mtConfirmation, [mbYes] + [mbNo], mrNo, 0) = mrYes then
ShowMessage('Yes clicked!');
end;