Hallo zusammen,
ich hab 'n stringgrid und eine routine (hier aus dem forum) um die zeilen zu färben, aber der macht einfach nix...
habt ihr eine ahnung an was es liegen könnt?
Zitat:
object Form1: TForm1
Left = 0
Top = 0
AlphaBlend = True
Caption = 'Form1'
ClientHeight = 216
ClientWidth = 426
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object sg: TStringGrid
Left = 0
Top = 0
Width = 426
Height = 216
Align = alClient
ColCount = 32
DefaultColWidth = 19
DefaultRowHeight = 16
TabOrder = 0
OnDrawCell = sgDrawCell
ColWidths = (
19
20
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19
19)
end
end
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids;
type
TForm1 =
class(TForm)
sg: TStringGrid;
procedure sgDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.sgDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
inherited;
if not Odd(ARow)
then
begin
Canvas.Brush.Color := clWebMintcream;
Canvas.FillRect(Rect);
Canvas.TextOut(Rect.Left+2, Rect.Top+2, (sender
as tstringgrid).Cells[ACol, ARow]);
end;
end;
bin für jede Hilfe dankbar.