GRID.ItemFormat

Previous  Next

 

state = GRID.ItemFormat( BYVAL nControl AS INTEGER,

                         BYVAL row      AS INTEGER,

                         BYVAL column   AS INTEGER,

                        [BYVAL format   AS INTEGER],

                        [BYVAL setormod AS INTEGER=MG_FORMAT_SET] ) AS INTEGER

 

 

 

 

Set or modifies the text format of an individual cell. 

 

' SetItemFormat - Set/Add/Remove Options

CONST MG_FORMAT_SET           = 0   ' Set format using the supplied formats

CONST MG_FORMAT_ADD           = 1   ' Add supplied format to current

CONST MG_FORMAT_REMOVE        = -1  ' Remove supplied format to current

 

' Text Formatting options to use with SetItemFormat

CONST MG_DT_TOP               = 0x00000000   ' Justifies the text to the top of the cell

CONST MG_DT_LEFT              = 0x00000000   ' Aligns text to the left

CONST MG_DT_CENTER            = 0x00000001   ' Centers text horizontally in the cell

CONST MG_DT_RIGHT             = 0x00000002   ' Aligns text to the right

CONST MG_DT_VCENTER           = 0x00000004   ' Centers text vertically

CONST MG_DT_BOTTOM            = 0x00000008   ' Justifies the text to the bottom of the cell

CONST MG_DT_SINGLELINE        = 0x00000020   ' Displays text on a single line only.

CONST MG_DT_NOPREFIX          = 0x00000800   ' Turns off processing of prefix characters.

CONST MG_DT_END_ELLIPSIS      = 0x00008000   ' If the end of a string does not fit, it is truncated and

                                            ' ellipses are added.  Not compatible with DT_NOCLIP

CONST MG_DT_NOCLIP            = 0x00000100   ' Draws without clipping so text longer than cell width

                                            ' will overwrite text in next cell.  This can be useful

                                            ' when you need text to expand over several cells such

                                            ' as a header.  Use this together with SetItemBorders

                                            ' to remove left and right border lines

 

Example:

 

' Make first row Read Only and Center Items

GRID.ItemReadOnly( nControl, 1, -1, TRUE )

GRID.ItemFormat( nControl, 1, -1, MG_DT_CENTER )

 

GRID.Refresh( nControl )