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!

How can I lock the position of a screen object

Tips -N- Tricks

How can I lock the position of a screen object

by  ChrisRChamberlain  Posted    (Edited  )
If you want to lock a FoxPro screen object such a MODI FILE window, a report preview position or the position of a system, (not your own toolbar class), toolbar, etc, so that they always appear in the same position on screen, try the following:-

Position the object(s) on screen and immediately cancel out of the project.

Now you need to find the relevant record(s) in the [color blue]FOXUSER.dbf[color black] to mark them as read-only.

To avoid manually searching through possibly hundreds of records, in the command window:-
[color blue]
SET RESO OFF
USE path\FOXUSER.dbf IN 0 EXCLUSIVE
SELE FOXUSER
INDEX ON FOXUSER.updated
SET ORDER TO TAG updated
GO BOTT
BROW
[color black]
By indexing and going bottom, you should then be able to identify the object(s),(they are now the last records in the browse screen), from the [color blue]FOXUSER.id[color black] field, [color blue]TTOOLBAR[color black] being toolbar, [color blue]REPORTPOS[color black] being report position etc.

Change the FOXUSER.readonly value(s) from [color blue].F.[color black] to [color blue].T.[color black], and this will "lock" the object in the last position.

Then:-
[color blue]
DELE TAG updated
USE IN FOXUSER
[color black]
This is a better technique than making the whole [color blue]FOXUSER.dbf[color black] readonly, because if you do so, [color blue]FOXUSER.dbf[color black] will not save the coordinates, etc of the objects you do want to resize, reposition etc.

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top