FMX版的對話框 Dialog 用法跟之前不同
雖然舊版的呼叫方式一樣可以用
但在手機上 跳出Dlg後就自動往下跑了 不會Hold在那裏等待
MessageDlg('Choose a button:', System.UITypes.TMsgDlgType.mtInformation,
[
System.UITypes.TMsgDlgBtn.mbYes,
System.UITypes.TMsgDlgBtn.mbNo,
System.UITypes.TMsgDlgBtn.mbCancel
], 0,
procedure(const AResult: System.UITypes.TModalResult)
begin
case AResult of
mrYES:
ShowMessage('You chose Yes');
mrNo:
ShowMessage('You chose No');
mrCancel:
ShowMessage('You chose Cancel');
end;
end);
InputBox('What do you want to say?','','Stuff',
procedure(const AResult: TModalResult; const AValue: string)
begin
case AResult of
{ Detect which button was pushed and show a different message }
mrOk:
begin
// AValue is the result of the inputbox dialog
showmessage(AValue);
end;
mrCancel:
begin
end;
end;
end
);
文章標籤
全站熱搜