Einzelnen Beitrag anzeigen

strom

Registriert seit: 23. Aug 2008
Ort: Keine Ergebnisse gefunden
290 Beiträge
 
#3

AW: StringGrid roter Rahmen

  Alt 1. Mai 2016, 17:20
hey,

ist nur ein Ausschnitt!

Delphi-Quellcode:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
   StringGrid1.Canvas.Font.Color := clblack;

  if StringGrid1.Cells[0, ARow] = '1then
   begin
    StringGrid1.Canvas.Brush.Color := $004080FF;
   end else
  if StringGrid1.Cells[0, ARow] = '2then
   begin
    StringGrid1.Canvas.Brush.Color := $004080FF;
   end else
  if StringGrid1.Cells[0, ARow] = '3then
   begin
    StringGrid1.Canvas.Brush.Color := $004080FF;
   end else
  if StringGrid1.Cells[0, ARow] = '11then
   begin
    StringGrid1.Canvas.Brush.Color := $004080FF;
   end else
  if StringGrid1.Cells[0, ARow] = '4then
   begin
    StringGrid1.Canvas.Brush.Color := clYellow;
   end else
  if StringGrid1.Cells[0, ARow] = '5then
   begin
    StringGrid1.Canvas.Brush.Color := clyellow;
   end else
  if StringGrid1.Cells[0, ARow] = '6then
   begin
    StringGrid1.Canvas.Brush.Color := clYellow;
   end else
  if StringGrid1.Cells[0, ARow] = '7then
   begin
    StringGrid1.Canvas.Brush.Color := clYellow;
   end else
  if StringGrid1.Cells[0, ARow] = '8then
   begin
    StringGrid1.Canvas.Brush.Color := clYellow;
   end else
  if StringGrid1.Cells[0, ARow] = '9then
   begin
    StringGrid1.Canvas.Brush.Color := clYellow;
   end else
  if StringGrid1.Cells[0, ARow] = '10then
   begin
    StringGrid1.Canvas.Brush.Color := clYellow;
   end;
  if gdSelected in State then
   StringGrid1.Canvas.Brush.Color := clMenu;
   StringGrid1.Canvas.FillRect( Rect );
   StringGrid1.Canvas.TextRect( Rect, Rect.Left, Rect.Top, StringGrid1.Cells[ACol, ARow] );

   Stringgrid1.Canvas.Pen.Color:=clRed;
   //Stringgrid1.Canvas.Rectangle(Rect.Left, Rect.Top, Rect.Right StringGrid1.cells[aCol, aRow]); // was ist hier falsch?
end;
  Mit Zitat antworten Zitat