System Modal Advmemofinddialog

Advmemofinddialog is displayed as system modal when used with advfinddialog and the memo is on a secondary form.

To see this, create two forms. Place a button on the primary form to launch the secondary form using form2.showmodal. On the secondary form, place an advmemo, advmemofinddialog and an advfinddialog. Connect the advememofinddialog to the advmemo and the advfinddialog. Add a button with advmemofinddialog1.execute. Click the button. Cover the find dialog with another window. Result: find dialog remains on top of the window that should be coverering it. Two necessary conditions for this to happen: the memo and dialog must be on a secondary form that is displayed as modal and advfinddialog must be used (advmemofinddialog alone does not suffice).

Thank you!

The dialog is not shown modal, it is shown with the fsStayOnTop style. It is needed that interaction with the memo is still possible when the dialog is displayed, therefore, it can't be modal. It is needed that is appears on top of the memo, therefore the fsStayOnTop style is used.

An alternative way to keep the find dialog on top of the form containing the memo is to use the find dialogs popupmode property.

TAdvFindDialog.Execute currently contains: 
.
.
  frm.FormStyle := fsStayOnTop;
  Frm.Show;

Please consider changing those lines to:
  Frm.popupmode := pmexplicit;
  Frm.Show;
  Frm.PopupParent := Frm.Parent as TCustomForm;

The modified code ensures that the find dialog stays on top of the parent form, but it allows other applications to be on top when they are activated.

I would just override TAdvFIndDialog.Execute rather than suggesting this change but doing so is impractical because the method references a protected method.

Thank you for considering this suggestion.

We'll apply this improvement for the next update.

Bruno,

Thanks again for making the change suggested above. I have worked further with this dialog and suggest one further modification:
Change "frm.PopupParent := frm.parent as TCustomForm;"
To: "Frm.PopupParent := Owner as TCustomForm;"

The reason I am suggesting this change is that frm.parent is always nil when the code executes, which causes frm.popupparent to default to the application's main form. This causes problems with Z order when the finddialog is displayed from a secondary form. The same issue of course applies to the AdvMemoFindReplaceDialog.

Thank you!

Thanks for your feedback.
We'll apply this suggested improvement.