Web Dialog needs to wait for another Web Dialog

I have a WebDialog AccountMaintenance_Dialog that has a WebButton whose Caption can change. When the Caption = Delete then I want to display another WebDialog DeleteUser_Dialog

This dialog asks the user are they sure they want to delete? This second WebDialog DeleteUser_Dialog has two WebButtons ‘Cancel’ and ‘Delete’. Both call a Method DeleteUser after setting To_Delete_or_Not_to_Delete either as False or True respectively and the Method DeleteUser returns a Boolean.

I thought I was setting this up to enable AddHandler in AccountMaintenance_Dialog but cannot set the AddHandler statement correctly before showing DeleteUser_Dialog

I have setup the following in AccountMaintenance_Dialog but the AddHandler fails when Analyzed. A syntax error is returned on AddHandler req.DeleteUser WeakAddressOf req.

Dim req As New DeleteUser_Dialog
AddHandler req.DeleteUser WeakAddressOf req
req.Show

'-- Get returned value and see if we should delete
If req.To_Delete_or_Not_to_Delete Then
'--some code
End

I have attempted many variations to get this to compile and run but have not been successful.

I have also read several threads on this topic and looked at the example Advanced - AddHandler - AddHandler.xojo_binary_project which uses a Timer and cannot make heads or tails of how to use this for what I need.

So how does one setup to wait on a second dialog to perform an appropriate action?

I would show the dialog as per normal and implement the dismissed event handler to perform the task if required.

Normal is what I was doing and the code went right by DeleteUser_Dialog.Show so I do not know what you mean by ‘normal’

As I understand the way to do this is with AddHandler where you can pass multiple parameters back. Thats the solution path I am looking for

If you us addhandler on the you create pass the class as it’s first param.
MyHandlerMethod( Instance as WebDialog )

It is not clear to me how to implement

Do you add MyHandlerMethod( Instance as WebDialog ) as a Method or Property in DeleteUser_Dialog
Or
In AccountMaintenance_Dialog

I have attempted both and this does not work

Let me restate what I am trying to do in a WebDialog

I have a WebDialog1 and a WebDialog2

WebDialog1 is placed on a WebPage and when the User selects Delete from WebDialog1 WebDialog2 is displayed and WebDialog1 is on hold waiting for a response from WebDialog2.

Then in WebDialog2 the User selects either Cancel or Delete (This could be implemented either as two separate WebButtons or a WebPopupMenu either will do.

Then after the User makes their selection WebDialog2 informs WebDialog1 and now WebDialog1 continues checking the response from WebDialog2

Does that make sense and if so how can this be accomplished?

Have a look at https://www.dropbox.com/s/lnd4qh7cchzwdgp/dialogdemo.xojo_binary_project?dl=0

@Wayne Golding - very nice. I was over complicating the need. Thank you