On Thursday 09 August 2018 20:11:52 Patrick Goupell wrote:
> I can set a column of a stringgrid to a specific color using
> tstringgrid.datacols.cols [n].color := cl_green;
>
> Is it possible to set a specific column/row only to a color?  What is
> the correct pascal coding to do it (I haven't been able to get it right
> yet)?

It is possible to set a color to a specific row by setting 
<grid>.rowcolors[<row>].
An other option is to set <grid>[<col>][<row>].selected which shows 
<grid>[<col>].colorselect.
Individual cell colors must be set in 
<grid>.datacols[<col>].onbeforedrawcell().
"
procedure tmainfo.befdrawcellev(const sender: tcol; const canvas: tcanvas;
               var cellinfo: cellinfoty; var processed: Boolean);
begin
 if cellinfo.cell.row = 2 then begin
  cellinfo.color:= cl_green;
 end;
end;
"
Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to