Solved

How to color single cell in TStringGrid ?;

Posted on 2004-04-13
2
430 Views
Last Modified: 2010-08-05
Is any way how to color single cells  (TS1.Cells[r,s]  ) in TStringGrid ?
0
Comment
Question by:hatina
2 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 50 total points
ID: 10811442
Yes

procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
  if (ACol = 3) and (ARow = 2) then
    begin
    with StringGrid1 do
      begin
      Canvas.Brush.Color := clYellow;
      Canvas.FillRect(Rect);
      Canvas.TextOut(Rect.Left+2,Rect.Top+2,Cells[ACol, ARow]);
      end;
    end;
end;
0
 

Author Comment

by:hatina
ID: 10812096
Thank you, it suits. Points are yours
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mobile Keyboard covers the display of the TMemo 3 103
Delphi Form ownership 4 127
Error E2158 compiling with Delphi XE10 Seattle 2 127
DBCtrlGrid, Delphi, Scroll 7 33
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question