AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein GUI-Design mit VCL / FireMonkey / Common Controls Delphi tStringgrid und Zeilenfärben --> Verzweiflung
Thema durchsuchen
Ansicht
Themen-Optionen

tStringgrid und Zeilenfärben --> Verzweiflung

Ein Thema von GreenHorn3600 · begonnen am 2. Sep 2007 · letzter Beitrag vom 2. Sep 2007
 
GreenHorn3600

Registriert seit: 24. Jun 2007
165 Beiträge
 
#1

tStringgrid und Zeilenfärben --> Verzweiflung

  Alt 2. Sep 2007, 12:05
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.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:49 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz