QG_SetAreaAlignment
QG_SetAreaAlignment(areaRef; horzAlign; vertAlign):errorCode | |||
---|---|---|---|
![]() |
areaRef | Longint | QGrid area reference |
![]() |
horzAlign | Longint | Horizontal alignment |
![]() |
vertAlign | Longint | Vertical alignment |
![]() |
error | Longint | Error result |
Set the cell alignment inside a QGrid area
Parameter areaRef is the QGrid area reference. If areaRef is not a valid QGrid area reference, qg_paramErr error is returned.
Parameters horzAlign and vertAlign specify how the grid cells will be aligned inside the QGrid area rectangle. Acceptable alignment values are listed below:
qg_AlignHorzLeft | 0 | Horizontally align to the left |
qg_AlignHorzCenter | 1 | Horizontally align to the center |
qg_AlignHorzRight | 2 | Horizontally align to the right |
qg_AlignVertTop | 0 | Vertically align to the top |
qg_AlignVertCenter | 1 | Vertically align to the center |
qg_AlignVertBottom | 2 | Vertically align to the bottom |
TIP Use the reserved value -1 to leave an alignment parameter unchanged while modifying the other.
NOTE If this command is not called, the default values are used (qg_AlignHorzLeft and qg_AlignVertTop for horizontal and vertical alignment respectively).
Example
// Center the cells inside the xGrid area. C_LONGINT($err) $err:=QG_SetAreaAlignment (xGrid;qg_AlignVertCenter;qg_AlignHorzCenter) ASSERT($err=qg_noErr)
Related commands
QG_GetAreaAlignment | Get the current cell alignment in a QGrid area |