| {\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}} {\colortbl\red0\green0\blue0;} \deflang1044\pard\plain\f0\fs17 This is used to align the flexgrid currently to center, but can be changed to something else. Call this sub after each time you change the amount of rows and cols, because after a row or column is added, the current alignment is not retained. \par \par Sub AlignGrid() \par Dim I As Integer, Y As Integer \par \par 'FG1 is currently the name of the Flexgrid. Change it to \par 'whatever you called your Flexgrid. I make the grid invisible \par 'before I change all the alignments, because it goes so much \par 'faster, and it doesn't look funky. \par \par FG1.Visible = False \par For I = 0 To FG1.Rows - 1 \par For Y = 0 To FG1.Cols - 1 \par FG1.Row = I \par FG1.Col = Y \par \par 'Change this value to whatever, 2 is left/center, \par '4 is center/center \par \par FG1.CellAlignment = 2 \par Next \par Next \par FG1.Visible = True \par End Sub \par } |
Align Flexgrid Cells after Adding a Row or Column |
Express News India | Freelance ecommerce web development India