Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi StringGrid Problem nach draw cell (https://www.delphipraxis.net/34301-stringgrid-problem-nach-draw-cell.html)

MrFish 20. Nov 2004 18:41


StringGrid Problem nach draw cell
 
Nabend an alle; :hi:

Ich habe mit Folgendem Code Zellen im StrinGrid eingfärbt.
Code:
 with Sender as TStringGrid do
        begin
          s := Cells[ACol, ARow];
          Canvas.Brush.Color := CellColor[Acol,Arow];
          Canvas.FillRect(Rect);
          DrawText(Canvas.Handle, PChar(s), Length(s), Rect, DT_CENTER);
        end;
Funktioniert nur wird jetzt die jeweils markierte Zelle in weiss hinterlegt, und nicht wie normal in blau.Da die Schrift ebenfalls in weiss dargestellt wird, solange die zelle selektiert ist, ist das ziemlich blöd.
Ich habe bereits versucht FillRect Brush auf clBackground zu stellen. ohne Erfolg. Wat nu?

Keldorn 20. Nov 2004 20:13

Re: StringGrid Problem nach draw cell
 
Hallo

du mußt den State abfragen und die Selektionsfarbe entsprechend setzen
Delphi-Quellcode:
if gdselected in state then canvas.Brush.Color:=clHighlight;
canvas.fillrect...
Mfg Frank

MrFish 21. Nov 2004 10:51

Re: StringGrid Problem nach draw cell
 
Klappt!


Ich danke dir.

Gruß MrFish :hello:


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:16 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz