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

AUTOMATICALLY DOCKING PRINT PREVIEW TOOLBAR 2

Status
Not open for further replies.

craigsboyd

IS-IT--Management
Joined
Nov 9, 2002
Messages
2,839
Location
US
Is there a way that I can dock the print preview toolbar as soon as the print preview comes up...through code? Slighthaze = NULL
 
well, what i did was bring up vfp 7 and made it so the preview toolbar was docked and then copied the foxuser.dbf and foxuser.fpt files to the application's root directory and then SET RESOURCE TO "FOXUSER.DBF" in the main.prg of the application...works good except that sometimes the very first preview window i bring up has the toolbar undocked still. After that all subsequent previews come up with toolbar docked correctly..weird. I am still a little miffed that there isn't a way to dock that toolbar through code. If anyone figures anything out i am all ears. Slighthaze = NULL
 
slighthaze

Try faq184-940 - 'How can I lock the position of a screen object'
FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Thanks Chris...essentially what I am doing, but I did have the entire foxuser.dbf as readonly and will change it so that just the toolbar record is marked as readonly...nice trick...appreciate the help Slighthaze = NULL
 
any other ideas guys? Slighthaze = NULL
 
Mike,

It does work, however the program was running with Resource=OFF before and I am a little concerned about

1. Performance Issues - plenty of documentation that Resource=OFF is less resource intensive
2. Bugs coming up in the program do to the users having their settings saved...I have scoured the web to find what all is saved in foxuser.dbf and can't find anything that really tells me

So, I am still hoping that someone here knows how to dock that toolbar in code...would like to rid myself of the foxuser.dbf dependence Slighthaze = NULL
 
Hi SLighthaze,

One way you could handle this, is to include the RESOURCEFILE in different flavours.

For example..
Save the FoxUser.* with the docked Preview.. and only that record set as REad ONLy.. as PrintFox.*

Then every time you get into the print routine..
SET RESOURCES TO PrintFox
REPORT.....
SET RESOURCES TO DEFA

Again, if required, the PrintFox.* can be even SELECTED from your saved set in the distribution by an SQL and saved with a SYS(3) file in your harddisk.. Set the resources.. and then close the file.. delete it.. all on the fly.

:-) ramani :-)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
thanks Ramani...I guess that will work...still feels like this whole thing is kind of a hack though...doesn't it seem like you should be able to dock that toolbar through code? I'll implement it like this for now, but i'm still hopeful that there is some kind of coding solution to this...perhaps the foxuser.dbf is the only thing provided for this sort of thing and i'll just have to go with this until they give us something better in an upcoming version of Visual Foxpro...i do appreciate everyone's input into this and feel more confident that i haven't overlooked some kind of easy coding solution to the problem Slighthaze = NULL
 
SlightHaze

1. Performance Issues - plenty of documentation that Resource=OFF is less resource intensive

Really? I have never really seen anything that supports that. Anyways, setting resources off your app will still create a foxuser table. But I cannot imagine that a table with a few records (or even one in your case) would drain the resources.

2. Bugs coming up in the program do to the users having their settings saved...I have scoured the web to find what all is saved in foxuser.dbf and can't find anything that really tells me

Mainly positions of windows and toolbars. But in your case you only need one record, the one that holds the information about the position of your print preview toolbar.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first or check this link
 
Mike,

Thanks for the the info...I had absolutely no idea that you could delete all those other records in there and it would still function correctly...ok, now I think i have a solution that I am sufficiently comfortable with...and yes, having resource=on slows start-up speed, execution during runtime, and shutdown speed...perhaps not significantly but it all adds up after time...however a single record in a single table with a single purpose i can live with...thanks again to all who took the time. Slighthaze = NULL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top