AdvMessageDialog modal use

When I run the demo for AdvMessageDialog the pop up dialog is shown modal and all other controls on the form are disabled until the pop up dialog is closed.
When I try and replicate this in my own code the pop up is not modal and the user can access the controls on the parent form.
I have checked all the properties I can find for both the actual form and AdvMessageDialg and I can see no missing parameters.

I have also tried call it using TIWAdvMessageDialog1.ShowAsync; and TIWAdvMessageDialog1.Show;

How can I make the popup modal ?


Can you please make sure the TIWAdvMessageDialog is placed directly on the form and not inside a region or a frame?

Hi Bart,
That has helped but I am still confused over its usage.
I have an OnAsyncButtonClick event on the dialog similar to the demo program but setting a global result variable DlgResult which I should then be able to interogate after the popup dialog has closed. See below...

procedure TIWFShipment.TIWAdvMessageDialog1AsyncButtonClick(Sender: TObject;
  EventParams: TStringList; ButtonIndex: Integer; InputString,
  InputPassword: string; InputCheck: Boolean; var Allow: Boolean);
  if ButtonIndex = 0 then
    DlgResult := 'OK'
  else if ButtonIndex = 1 then
    DlgResult := 'YES'
  else if ButtonIndex = 2 then
    DlgResult := 'NO'
    DlgResult := 'OTHER';

  if (InputString <> EmptyStr) and (InputString <> TIWAdvMessageDialog1.EmptyText) then
    DlgResultText :=  InputString;

//  if TIWAdvMessageDialog1.VerificationCheckBoxChecked then
//    DlgResultText := IWLabel1.Text + ': Verification = checked';


The call then checks the result and actions as required. But the first time the button is actioned to display the popup dialog the result is not set correctly.

the calling code is below and I have tried it on the OnClick and OnAsyncClick

  if DlgResult = 'YES'
    then begin

From your previous reply it would appear that the placing of the controls on the form or region is critical. Is there any documentation on how they should be used ?

Hi Mark,

- I'm not sure why you would expect the DlgResult to be set directly after calling ShowAsync?
From the code you provided, I would assume the DlgResult will only be set after the IWAdvMessagDialog.OnAsyncButtonClick was fired. The event would only have been triggered once a button on the dialog has been clicked.

- Unfortunately there is currently no specific documentation available for the IWAdvMessageDialog.
Please refer to the AdvMessageDialog page in the TMS IW FeaturesDemo for an example of the control's functionality.