Einzelnen Beitrag anzeigen

soulies

Registriert seit: 9. Dez 2005
234 Beiträge
 
#3

Re: Label audrucken, mit Zeilenumbruch.

  Alt 10. Dez 2008, 12:18
hoi,

einfach mal so als denkanstoss vllt. (keine garantie des es funzt)

Delphi-Quellcode:
var
   x,y,font_heigth,position : Integer ;
   tmp_row,part : String ;
begin
     x := 200 ;
     y := 200 ;
     font_heigth := Abs(Dein_Label.Font.Height) * Dein_Label.Font.Size ;

     Printer.BeginDoc;
       tmp_row := Dein_Label.Caption ;
       if (Pos(#13#10,tmp_row) > 0) then
        begin
          repeat
            position := Pos(#13#10,tmp_row);
            if (position > 0) then
               part := Copy(tmp_row,1,position-1)
            else
               part := tmp_row ;
            Printer.Canvas.TextOut(x,y,part);
            Delete(tmp_row,1,position+1);
            y := y + font_heigth ;
          until
            position <= 0;
        end
       else
        begin
          Printer.Canvas.TextOut(x,y,tmp_row);
        end;
     Printer.EndDoc;
end;
cya
  Mit Zitat antworten Zitat