Specifies where the grid's left and right panels split.
grdGrid.Partition = nWhere2Split
nWhere2Split = grdGrid.Partition
Parameter |
Value |
Meaning |
nWhere2Split |
Numeric |
Specifies the pixel location where the left and right panels are split. This is always expressed in pixels and is not affected by ScaleMode. |
The partition must have a value from 0 (for no split) to a value slightly less than the grid's Width property.
To be able to set Partition to the full range of the grid, set Scrollbars to 0 and then restore it after setting Partition where you like. You can use SYSMETRIC(5) to determine the width of the scrollbars.
In VFP 3.0, there seems to be no way to turn off the partition completely. The SplitBar property was introduced in VFP 5. We've had more than a few clients confuse themselves terribly by messing with the partition and then being unable to make things right; it's great to be able to protect them from themselves. If SplitBar is set to .F., the setting of Partition is ignored.
In versions of FoxPro before 6.0, you can't even detect the partition being moved, except by trapping the value of Partition in MouseDown and checking it in each MouseUp. In 6.0, we thought of two new possibilities. You could test for the "SplitBar" value in GridHitTest. The only problem with this is that Partition is not assigned new values while the splitbar is being dragged, only when it stops, so you might as well stick with the MouseDown, MouseUp trick. The other idea we had was to add a Partition_Assign method to the grid.
While we would hardly ever consider using a partitionable grid in an application, the fine control we have is reassuring.
grdGrid1.Partition = 143
Access, Assign, GridHitTest, Panel, PanelLink, ScrollBars, SplitBar