![]() |
HIIILLLFE
Ich will ein Memofeld ausdrucken mit dem PrintDialog, weiss aber nicht wie!!
Kann mir jemand helfen mit dem Quelltext??? |
Re: HIIILLLFE
Hallo!
Schön wär es wenn du erstmal deinen Titel änderst und dann mal die ![]() MFG Florian :hi: |
Re: HIIILLLFE
Ich wüsste wie, aber ich sage es nicht, bevor Du Deinem Thread nicht einen aussagekräftigen Titel gegeben hast, der im Groben Dein Problem umschreibt.
|
Re: HIIILLLFE
HHHHIIIEEERRRR:
![]() EDIT1: hmmm "die-Daniel-und-Flomei-waren-schneller"-Warnung kam garnicht?! :gruebel: |
Re: HIIILLLFE
logik und deine suche ergibt keine treffer ^^
naja
Delphi-Quellcode:
Quelle : Delphi Manager 2.0.0.6
uses
printers; procedure TForm1.Button1Click(Sender: TObject); var I : Integer; LineHeight : Integer; LinesPerPage : Integer; LineCount : Integer; R : TRect; S : string; printer : Tprinter; begin printer:= TPrinter.Create; if PrintDialog1.Execute then begin Printer.Title := 'Notepad - ' + 'THE FILENAME'; Printer.Canvas.Font := Memo1.Font; LineHeight := Abs( MulDiv(Printer.Canvas.Font.Size, GetDeviceCaps(Printer.Handle, LOGPIXELSY), 72)); Inc(LineHeight, (LineHeight * 4) div 10); LinesPerPage := (Printer.PageHeight div lineHeight) - 4; LineCount := 4; Printer.BeginDoc; R.Top := LineHeight; R.Left := 30; R.Right := Printer.PageWidth; R.Bottom := LineHeight * 2; DrawText(Printer.Handle, PChar('THE FILENAME'), -1, R, DT_CENTER); for I := 0 to Pred(Memo1.Lines.Count) do begin Inc(LineCount); if LineCount = LinesPerPage then begin LineCount := 4; Printer.NewPage; end; S := Memo1.Lines.Strings[I]; Printer.Canvas.TextOut(0, LineCount * LineHeight, S); end; Printer.EndDoc; end; printer.free; end; Aber troztdem nächstes mal den Titel besser wählen :wink: |
Re: HIIILLLFE
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:59 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