procedure TForm1.Button1Click(Sender: TObject);
var
R: TRect;
OneInch: Integer;
begin
Form2.Show;
with Form2.PrintPreview do
begin
OneInch := ConvertUnit(10, mmLoEnglish, Units);
SetRect(R, 0, 0, PaperWidth, PaperHeight);
InflateRect(R, -OneInch, -OneInch);
PaintRichText(R, RichEdit1, 0, nil);
end;
end;
procedure TForm2.PrintRichEdit(RichEdit: TCustomRichEdit);
var
R: TRect;
OneInch: Integer;
begin
with PrintPreview do
begin
OneInch := ConvertUnit(10, mmLoEnglish, Units);
SetRect(R, 0, 0, PaperWidth, PaperHeight);
InflateRect(R, -OneInch, -OneInch);
PaintRichText(R, RichEdit, 0, nil);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
Form2.PrintRichEdit(RichEdit1);
end;
Return to DELPHI AREA Projects
Users browsing this forum: No registered users and 16 guests