Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2008 Jul : Modal form goes un-modal ??

www.cryer.info
Managed Newsgroup Archive

Modal form goes un-modal ??

Subject:Modal form goes un-modal ??
Posted by:"Jacob Havkrog" (a@a.a)
Date:Sun, 6 Jul 2008 00:13:17

Hi -

I've gat a form A the is shown modally

On A there is a Print button, that will send whats displayed on A to be
printed.

My problem is, that after printing, A is no longer modal, and can be hidden
behind the main form of my program.

How can a modal form go un-modal without ModalResult is being set?


Something like this:

calling ShowA(true):

procedure TMainForm.ShowA(preview: boolean);
begin
  if preview then begin
    A.DrawOnFormCanvas;
    A.ShowModal
  end else begin
    A.DrawOnPrinterCanvas;
    A.PrintMe
  end
end;

procedure TA.PrintButtonClick
begin
   MainForm.ShowA(false)
end;

After the print button is clicked, the form is not modal anymore.

Thanks for your help.
Jacob

Replies:

www.cryer.info
Managed Newsgroup Archive