Jump to content
uniGUI Discussion Forums
Sign in to follow this  
jahlxx

stringgrid color cell

Recommended Posts

Hi.

 

How to set a color to a cell of a stringgrid.

For example, set the cell [4,7] to red.

 

thanks.

 

Share this post


Link to post
Share on other sites

You can use the TUniStringGrid.OnDrawCell event handler to set the cell colors.

procedure TMainForm.UniStringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  var Value: string; Attribs: TUniCellAttribs);
begin
  if (ACol = 4) and (ARow = 7) then
    Attribs.Color := clRed;
end;

 

 

 

Share this post


Link to post
Share on other sites

Please look at this demo:

\FMSoft\Framework\uniGUI\Demos\Desktop\StringGrid Demo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×