开发者

Closing modeless Rave Reports windows programmatically

开发者 https://www.devze.com 2022-12-20 13:01 出处:网络
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.

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

精彩评论

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

关注公众号