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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't deactivate a user defined window !

Status
Not open for further replies.

kueyiar

Programmer
Mar 19, 2002
47
HN
I've created a user defined window where i'm displaying a report. I've also created a toolbar that helps me advance forwards and backwards. I've createde an "exit" button on my user defined toolbar and in the click event i've placed DEACTIVATE WINDOW rptWindow, where rptWindow is the name of my user defined window, but it doesn't close it at all.
But if i use the EXIT button on vfp's Print Preview toolbar, then the user defined window is closed.
I'ver tried DEACTIVATE WINDOW, RELEASE WINDOW even tried hiding it, but it doesn't work.

Does anyone have an idea of what i should do !? Thanks in advanced !
[afro]
 
How and where do you create this window? It sounds like you have a 'reference' to it somewhere. You'll need to find it, and set it to NULL before the RELEASE will work.

Rick
 
Yes, i created it with a DEFINE WINDOS rptWindow ....etc
Giving it all the parameters i like.
before i run the REPORT FORM, i create the new toolbar WITH :
varTOOL=CREATEOBJECT("myTOOL")
varTOOL.SHOW

After that, i call the report form like so :
REPORT FORM .......... PREVIEW WINDOW rptWindow(where rptWindow is my user defined window)

The report opens fine on the user defined window, the problem is that i have a button on my user defined toolbar "myTOOL" where i placed on the click event the command "DEACTIVATE WINDOW rptWindow", but nothing happens. Only if i select the exit button on vfp's print preview toolbar will the user defined window used to display the report will close !
Any ideas ?
 
Try releasing varTOOL before deactivating the window:
[tt]
release varTOOL
DEACTIVATE WINDOW rptWindow
[/tt]
Ian
 
I tried it like u said. It releases my user defined toolbar, but the user defined window remains !
 
Oh, wait...you still have the report itself active. That's probably what's holding you up.

I've never mucked with the VFP Print Toolbar itself, but there are 2 solutions I can think of. Programmatically trigger the standard Print toolbar's Exit button, or use this command:
[tt]
KEYBOARD CHR(27)
[/tt]
I haven't tested this, but it SHOULD work.

Ian
 
Thank u sooo much !!
I've been using KEYBOARD "{ESC}" but had a cancelation error appearing. But now with your tip, it works fine, thank u very much !
[AFRO]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top