Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Preview Toolbar - Closing 1

Status
Not open for further replies.

itflash

Programmer
Jul 18, 2001
535
GB

Hi All

When I do a preview for a report, I use the following code:

oRepForm = CREATEOBJECT("Form")
WITH oRepForm
.Caption = "Print Preview"
.WindowState = 2
.TitleBar = 0
.Show()
ENDWITH
REPORT FORM myreport PREVIEW WINDOW (orepform.name) NOCONSOLE
orepform.release()

However, the print preview toolbar has a close button (top right) and when the user clicks this, the form/report is left open with no way of closing it.

Any suggestions would be appreciated.

Thanks
ITflash



 
Hi ItFlash


1. Pressing ESC while in the report form should release the report form.

2. If ESC is set off, you can start with ESC on and then when you release the report, set it back.

3. Another possiblity is that you set the TitleBar=1 so that the titlebar appears for the window and you will have the X button at the top. You can set the _screen.TitleBar=0 when the printpreview is shown, so that you dont get a double titlebar. You can set that back, when the report is over.

:)

____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
Thanks

....sometimes you overlook the obvious things....



ITflash
[thumbsup2]
 

just to resurrect slightly..


WITH oRepForm
.Caption = "Print Preview"
.WindowState = 2
.TitleBar = 1
.maxbutton=.F.
.minbutton=.F.
.movable=.F.
* .borderstyle=2
.scrollbars=3
.Show()
ENDWITH


I just have a slight issue with the above.

If I have border style=2 (or anything other than 3), then no scroll bars appear - even with .scrollbars=3.

I want to remove the sizeable because the user can resize the form and see a blank form behind the report rather than see the _screen. Just tidying up.

Any ideas?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top