Einzelnen Beitrag anzeigen

Hansa

Registriert seit: 9. Jun 2002
Ort: Saarland
7.554 Beiträge
 
Delphi 8 Professional
 
#4
  Alt 5. Jul 2003, 18:31
Angeblich soll das hier "einzelne Zellen" zusammenfügen ":
Delphi-Quellcode:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var i, x, y: Integer;
begin
  if gdFixed in State then exit;
  if ARow <= 1 then exit;
  with sender as TStringGrid do begin
    if aCol < Pred(ColCount) then
      Rect.Right := Rect.Right + GridlineWidth;
    y:= Rect.Top + 2;
    x:= Rect.Left + 2;
    for i:= 1 to aCol-1 do
      x:= x - ColWidths[i] - GridlineWidth;
    Canvas.Brush.Color := clWhite;
    Canvas.Brush.Style := bsSolid;
    Canvas.FillRect(Rect);
    Canvas.TextRect(Rect, x, y, Cells[1,1] );

  end;
Leider verstehe ich es nicht richtig. Mit dem Canvas, dem Rect usw. hab ich nicht viel am Hut. Läßt es sich trotzdem für meinen Zweck gebrauchen ?

Quelle : www.delphi-source.de
Gruß
Hansa
  Mit Zitat antworten Zitat