lPara cName, cData, cHeader, nWidth, cFormat, cFont, cForeColor, cTag local nPos with Thisform.grid1 nPos= .ColumnCount+ 1 .addcolumn( nPos) with .Columns( nPos) .Name = cName .ControlSource = cData .FontSize= thisform.gridfont && 9 .Header1.caption= iif(left(cHeader,1)='-',substr(cHeader,2),cHeader) .width= nWidth .readonly=.t. if !empty( cFormat) and type( 'cFormat')= "C" .Inputmask= cFormat endif if !empty( cForeColor) and type( 'cForeColor')= "C" .ForeColor= &cForeColor endif if !empty( cFont) and type( 'cFont')= "C" .FontBold= iif( "B"$ cFont, .t., .f.) .FontItalic= iif( "I"$ cFont, .t., .f.) .Fontunderline= iif( "U"$ cFont, .t., .f.) do case && Text Alignment case "R" $ cFont .alignment= 1 case "C" $ cFont .alignment= 2 Endcase .tag= cFont endif * Header with .Header1 .alignment= 2 .ForeColor= RGB(29,29,29) .BackColor= rgb(253,245,222) .FontBold= .t. .FontSize= thisform.gridfont && 9 .FontName= "Arial" &&"MS Sans Serif" endwith endwith endWith