Delphi-PRAXiS
Seite 3 von 3     123   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Delphi DisplayFormat+TStringGridanzeige (https://www.delphipraxis.net/95633-displayformat-tstringgridanzeige.html)

mkinzler 14. Jul 2007 20:33

Re: DisplayFormat+TStringGridanzeige
 
Setzte das Alignment dementsprechend.

LOMBI 14. Jul 2007 21:14

Re: DisplayFormat+TStringGridanzeige
 
Meinst du so etwas?

Delphi-Quellcode:
EdVKnet.SetAlignment(taRightJustify);
Bei StringGrid gibt es kein Alignment.

DeddyH 14. Jul 2007 21:34

Re: DisplayFormat+TStringGridanzeige
 
Dann hilft Selberzeichnen. DefaultDrawing auf false und OnDrawCell z.B. so etwas:
Delphi-Quellcode:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var s: string;
    R: TRect;
begin
  if (ACol >= StringGrid1.FixedCols) and (ARow >= StringGrid1.FixedRows) then
    begin
      R := Types.Rect(Rect.Left, Rect.Top,Rect.Right - 2,Rect.Bottom - 2);
      s := StringGrid1.Cells[ACol,ARow];
      DrawText(StringGrid1.Canvas.Handle,PChar(s),-1, R,DT_RIGHT or DT_BOTTOM or DT_SINGLELINE);
    end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:26 Uhr.
Seite 3 von 3     123   

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