Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Buttons of ModalWindow - enabled:= true / false
#3
(03-11-2021, 10:52 AM)Jose Nilton Pace Wrote: Hi, see this demo.
Code:
  with IWModalWindow1 do begin
    Reset;
    Buttons.CommaText := '&Yes,&No,&Cancel,"I give &up|NoClose"';
    ...
    Show;
  end;
Code:
procedure TIWForm60.WindowDoOnAsyncClick(Sender: TObject; EventParams: TStringList);
var
  BtnCaption: string;
begin
  if IWModalWindow1.ButtonIndex >= 0 then begin
    BtnCaption := IWModalWindow1.ButtonCaption[IWModalWindow1.ButtonIndex]; // First ButtonIndex is 1, not 0
    WebApplication.ShowMessage('You clicked on button: ' + BtnCaption);
  end;
end;

Thank you Jose,
I've seen this example earlier.
This example does not answer my question.
Using the NoClose parameter, you can set the button behavior before the modal window appears.
I want to control the behavior of the button while the modal is already open.
Reply


Messages In This Thread
RE: Buttons of ModalWindow - enabled:= true / false - by I.Igor - 03-11-2021, 12:04 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)