Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid, Which can be resized
Message
 
À
09/04/1997 03:36:27
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordanie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00027553
Message ID:
00027599
Vues:
36
>I am having a form with 2 grids from child tables and few fields from parent.
>
>I want to give resizing facility of grid to the user, in which he can say zoom/enlarge it or reduce it....
>
>Any Suggestions ??

I have been resizing objects in forms for quite some time now and can give a little advice: I usually control the resizing of a grid through the resizing of the parent form. First I create two form properties called nOldWidth, nOldHeight and init them to the initial width and height in the init.

Then whenever the form's resize event triggers, I do this code:

private nIncWidth, nIncHeight
nIncWidth = thisform.nOldWidth - thisform.Width
nIncHeight = thisform.nOldHeight - thisform.Height

with thisform.Grid1
    .Move(.Left, .Top, .Width + m.IncWidth, .Height + m.IncHeight)
endwith


This code will resize the grid and then fire the grid's resize event where the variables nIncWidth and nIncHeight will still be valid and you can resize the column widths, etc in the resize event of the Grid. Note: it is important to use the Move method with this technique so that the objects that you are resizing only get one resize event. If you try to set the .Width or .Height separately, you will get two events and strange things will happen.

Note this technique also works for right aligning buttons and doing just about any resize effect that you could want:


with thisform.Command1
    .Move(.Left + m.nIncWidth)
endwith

for example...

HTH,
Peter
Peter Stephens
Visual Records, Inc.

Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform