AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

nochmals StringGridDrawcell

Ein Thema von fl63 · begonnen am 26. Aug 2009 · letzter Beitrag vom 29. Aug 2009
 
Hobby-Programmierer

Registriert seit: 19. Jan 2006
Ort: München
392 Beiträge
 
Delphi XE Starter
 
#11

Re: nochmals StringGridDrawcell

  Alt 26. Aug 2009, 16:51
Ich kenne das JediGrid zwar auch net, aber folgendes sollte auch damit funktionieren. Sonst teste mal einfach mit nem Standard Grid
Delphi-Quellcode:
procedure TForm1.SG1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
const tFormat = DT_SINGLELINE or DT_CENTER or DT_VCENTER;
var tText: String;
begin
  with (Sender as TStringGrid) do begin
    tText:= Trim(Cells[ACol, ARow]); // Text der Zelle
    if (gdFixed in State) then begin // feste Zelle?
      Canvas.Brush.Color:= clBtnFace; // HintergrundFarbe

      end else if (gdSelected in State) then begin // markierte Zelle
      Canvas.Brush.Color:= clHighlight;
      Canvas.Font.Color:= clBlack;

     end else begin // normale Zelle
      Canvas.Brush.Color:= clWindow;
      if tText = '2then Canvas.Brush.Color:= clgreen;
  // ...
  // ...
    end; // <> (gdFixed in State)
    Canvas.FillRect(Rect); // Hintergrund zeichnen
    DrawText(Canvas.Handle, PChar(tText), Length(tText), Rect, tFormat); // Textausgabe
  end; // with
end;
evtl. musst Du noch ACol, ARow in Col, Row umbenennen. DefaultDrwaing auf True

LG Mario
Mario
'Lesen Sie schnell, denn nichts ist beständiger als der Wandel im Internet!'
  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 16:35 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