![]() |
tStringGrid mit eigener Zeichenroutine --> Selektionsprob
Liste der Anhänge anzeigen (Anzahl: 2)
Hallo Zusammen,
ich hab 'n Stringgrid, bei dem ich die Zeichenroutine überschrieben hab. Funktioniert auch blendend.
Delphi-Quellcode:
Nur wenn ich da die Zeile im Grid selektiere, blendet er mir meinen Text aus ...
procedure tMyStringGrid.DrawCell(ACol, ARow: Integer; ARect: TRect;
AState: TGridDrawState); begin inherited; if not Odd(ARow) and not (gdFixed in aState) then begin Canvas.Brush.Color := clWebMintcream; Canvas.FillRect(aRect); Canvas.TextOut(aRect.Left+2, aRect.Top+2, Cells[ACol, ARow]); end; end; gibt es hier einen Trick, dass man nach der Selektion einer Zeile (row) auch noch den geschriebenen Text entziffern kann? Dank und Gruss gg PS: options.rowselect = true; |
Re: tStringGrid mit eigener Zeichenroutine --> Selektions
Hallo Kollegen,
jetzt hab ich die Lösung gefunden...
Delphi-Quellcode:
die Selektion musste noch ausgeschlossen werden.
procedure tSEStringGrid.DrawCell(ACol, ARow: Integer; ARect: TRect;
AState: TGridDrawState); begin inherited; if not Odd(ARow) and not ((gdFixed in aState) or (gdSelected in aState)) then begin Canvas.Brush.Color := clWebMintcream; Canvas.FillRect(aRect); Canvas.TextOut(aRect.Left+2, aRect.Top+2, Cells[ACol, ARow]); end; end; Grüsse und noch einen schönen Abend gg |
Re: tStringGrid mit eigener Zeichenroutine --> Selektions
Öhmm....
Ich weiß nun nicht ob ich da flasch liege.... aber der text wird nicht ausgeblendet... Das Probloem ist das an Weissen text nicht auf weisem Hintergrund Sieht... bzw mit dem Cream Text: ich habe es so gemacht:
Delphi-Quellcode:
MfG Real Thunder
if aRow > 0 then begin
c.Font.Color:=ClBlack; if (aRow mod 2) = 0 then begin c.Brush.Color := $00E6E7E8; c.FillRect(Rect); end else begin c.Brush.Color := ClWhite; c.FillRect(Rect); end; if arow = TStringgrid(sender).Row then begin c.Font.Color:=ClYellow; c.Brush.Color := ClBlue; c.FillRect(Rect); end; s := TStringGrid(sender).Cells[ACol, ARow]; c.FillRect(Rect); rect.Left:=rect.Left+5; rect.Top:=rect.Top+2; DrawText(c.Handle, PChar(s), Length(s), Rect, DT_SINGLELINE or DT_LEFT); end; habe bei mir allerdings ein rowselect drin..... ansonsten einfach die makierte zelle abfangen... und dass sollte es denn sein |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:09 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