开发者

Closing modeless Rave Reports windows programmatically

Friends

I use RR to produce print previews, based on a single TRVSystem (setting Modal to false, and redirecting the onPrint function to produce each preview, picking up and using the TBasereport.

It works well, but I need to ensure that all m开发者_StackOverflowodeless report windows are shut on program close in order to avoid exceptions.

Do I need to locate/enumerate the report windows in order to close them?


You can enumerate all open forms using the Screen singleton object and check if they are of a given TForm devivative type. If so, close down those forms:

var
  F: TCustomForm;
  i: Integer;
begin
  for i := Screen.FormCount - 1 downto 0 do begin
    F := Screen.Forms[ i ];
    if F is TMySpecialFormType then F.Free();
  end;
end;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜