Shahab: Looking for a colourful TStringGrid

Shahab-o-ddin Mokhtari <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
Hi
You can try this :
 
procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Longint;
  Rect: TRect; State: TGridDrawState);
var
  StringGrid : ^TStringGrid;
begin
  if not (Sender is TStringGrid) then
    Exit;
  StringGrid := @Sender;
  StringGrid^.canvas.font.color := clBlack;
  if (Col = StringGrid^.Col) and (Row = StringGrid^.Row) then begin  
    StringGrid^.canvas.brush.color := clRed;
  end else begin
    StringGrid^.canvas.brush.color := clBlack;
  end;
  StringGrid^.canvas.fillRect(rect);
  StringGrid^.canvas.TextRect(Rect, Rect.Left + 3, Rect.Top + 3, StringGrid^.cells[col, row]);
end;
 
You can change StringGrid^.Row and StringGrid^.Col to the cell col and row that you want to highlight !
note : make sure to set the StringGrid DefaultDrawing property to False ! else, the procedure will not Call ! :D
 
I was found this in another mail of group and make my version !!! :D ;) so thnx the sender !
My using way (Pointer and ...) was required for my application, so you can change all of StringGrid^  to for example StringGrid1. :D
 
Sorry for my weak English
 
Bye
 
Shahab :)
--------------------------------------

Angus Macdonald <[email protected]> wrote:
Hi guys and gals.
I'm looking for a TStringGrid component that allows me to set individual
background colors for particular cells. I'm putting together an in-house
helpdesk system and want to be able to highlight critical calls when they
arrive.

All suggestions gratefully received.
Angus

Yahoo! Groups SponsorADVERTISEMENT

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



Sincerely Yours
Shahab-o-ddin Mokhtari
 
[http://Ceramic81.150m.com]
[[email protected]]
[http://ShahabM.8m.com]


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

[Non-text portions of this message have been removed]



CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.