C1Elastic Reference > C1Elastic Properties > Grid Property |
Returns or sets parameters for the sizing grid (active when AutoSizeChildren is set to 'azGrid'.)
[form!]C1Elastic.Grid(Setting As GridSettings, [ Index As Variant ])[ = value As Variant ]
The Setting parameter determines the type of property you want to inspect or modify. Some settings require you to specify a row or column index, others do not. The table below lists all the settings:
Global Settings (Index parameter not required)
Constant |
Value |
Description |
gsRows |
0 |
Sets or returns the number of grid rows. This is equivalent to the GridRows property. |
gsCols |
1 |
Sets or returns the number of grid columns. This is equivalent to the GridCols property. |
Row Settings (Index parameter must be a value between 0 and GridRows - 1)
Constant |
Value |
Description |
gsRowTop |
2 |
Returns the y coordinate of the specified row, in twips. |
gsRowHeight |
4 |
Sets or returns the height of the specified row, in twips. |
gsRowFixed |
6 |
Sets or returns whether the height of the specified row is automatically adjusted when the control is resized. |
gsRowSplitter |
8 |
Sets or returns whether the bottom of the specified row may be dragged with the mouse at run time. |
gsInsertRow |
10 |
Setting to True inserts a row after the given row. |
gsDeleteRow |
12 |
Setting to True deletes the specified row. |
Column Settings (Index parameter must be a value between 0 and GridCols - 1)
Constant |
Value |
Description |
gsColLeft |
3 |
Returns the x coordinate of the specified column, in twips. |
gsColWidth |
5 |
Sets or returns the width of the specified column, in twips. |
gsColFixed |
7 |
Sets or returns whether the width of the specified column is automatically adjusted when the control is resized. |
gsColSplitter |
9 |
Sets or returns whether the right of the specified column may be dragged with the mouse at run time. |
gsInsertCol |
11 |
Setting to True inserts a column after the given column. |
gsDeleteCol |
13 |
Setting to True deletes the specified column. |
This property is useful when you want to build a resizing grid at run time, or modify an existing grid to obtain a different layout for the form. The distribution package includes samples that illustrate these techniques.
Note that you cannot make the last row or column work as splitters, since resizing them would require resizing the control.
Also note that when setting row heights and column widths, the values are rounded to the nearest pixel, and may thus be slightly off the original value. Furthermore, resizing a single row or column will cause other rows and columns to be resized as well, since the sum lf all rows and columns must fit within the control.
Use this property only if you need to modify a grid at run time. To create a grid at design time, use the Elastic's Grid editor.
Variant