![]() |
Problem beim färben von Stringgrid
hallo ich habe hier folgenden code:
Delphi-Quellcode:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState); begin if StringGrid1.cells[acol,arow] = 'N' then begin StringGrid1.Canvas.Brush.Color := clwhite; StringGrid1.Canvas.FillRect(Rect); StringGrid1.Canvas.font.Color := clred; StringGrid1.canvas.TextOut(acol,arow, StringGrid1.cells[Acol,Arow]); end; end; wenn das grid gezeichet wird sind zwar die fleder rot, aber der TEXT steht in der linken oberen ecke des grids! wieso!!???? |
Re: Problem beim färben von Stringgrid
Ersetz mal acol, arow beim TextOut durch Rect.Left, Rect.Top.
|
Re: Problem beim färben von Stringgrid
Weil du es ja so sagst!
acol, arow aind die Indizes der Felder nicht deren Koordinaten. Diese sind in Rect |
Re: Problem beim färben von Stringgrid
Vielen Dank, rect.left und rect.top hat funktioniert!
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:37 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 by Thomas Breitkreuz