Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid, Which can be resized
Message
 
To
09/04/1997 03:36:27
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00027553
Message ID:
00027597
Views:
47
If you mean changing row and column sizes, vfp grids by default can do that. I believe also by default you can resize the grid itself. If, however, you mean something similar to a minimize/maximize button like you find on forms and such you'll have to do the following:

Create a container class. Create 5 new properties: nHeight, nWidth, nLeft, and nTop, and lMax. On the container class you'll need to put an image class in the upper right hand corner. In the click method of the image classb add some code to switch between a maximized picture and a minimized picture (I just did a screen capture of the max/min buttons on a form). Also in the click method you'll need to resize the container. Something like:

LOCAL nValue
nValue = this.parent.top
this.parent.top = this.parent.nTop
this.parent.nTop = nValue

nValue = this.parent.left
this.parent.left = this.parent.nLeft
this.parent.nLeft = nValue

nValue = this.parent.height
this.parent.height = this.parent.nHeight
this.parent.nHeight = nValue

nValue = this.parent.width
this.parent.height = this.parent.nWidth
this.parent.nWidth = nValue

this.left = (this.parent.width - this.width) - 5 && Move to new corner coordinates
this.top = 5

IF this.parent.lMax && The cnt is being minimized, so change the pic to maxpic
this.picture = "maxpic.bmp"
ELSE
this.picture = "minpic.bmp"
ENDIF

this.parent.Refresh()

Note that the size properties will have to be seeded with values in each instance of this class and this assumes that your container is starting out minimized. You could add more code to determine the "container state" on init, but I didn't think it was worth the trouble.

Drop this container on your form and add your grid to it. Now all you need is a bit of code in your grid's Refresh method to resize it to slightly smaller than the container. Something like:

this.top = this.parent.top + 5 && 5 units from the top of the container
this.left = this.parent.left + 5 && 5 units from the left of the container
this.height = (this.parent.height - this.top) - 5 && 5 units from the bottom of the cnt
this.width = (this.parent.width - this.left) - 5 && 5 units from the left of the container


Have fun!

Michael G. Emmons
VFP Programmer Extroidinare



>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 ??

Michael G. Emmons
memmons@nc.rr.com
Previous
Reply
Map
View

Click here to load this message in the networking platform