Thank you very much. I will explore all the suggested options.
>In your case there is 3 options
>1-Even if you destroy the toolbar (button x) can close the form from the defined window but must be as this code ( add a close statement):
>
>DEFINE WINDOW RepWindow ;
> FROM 1, 1 TO 20, 20 ;
> TITLE "Report Title" close
>
>
>2-to hide the x button toolbar, can dock the toolbar for ex at top.then when you issue the close option in toolbar, the report closes
>
>3-can try with listener object option, even if you lost the toolbar, you can restore it with rightclick on report.
>
>of course issuing ESC closes the report.
>
>update : can also add the statement "system" to see the close button (as windows system) on defined window
>
>DEFINE WINDOW RepWindow ;
> FROM 1, 1 TO 20, 20 ;
> TITLE "Report Title" system
>
>
>*second update
>this follow code preview any report (print) using listener vfp9 class.the toolbar is docked and even if you free it and close it ,can rightclick on report to restore it--see the attached.
>
>oListener =Newobject("ReportListener")
>oListener.ListenerType=1
>Report Form ? Preview Object oListener
>
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham