Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Margins and Rich Text Control

Status
Not open for further replies.

corneasd

Programmer
Jul 31, 2002
10
0
0
ZA
Hallo,
I am loading an RTF file into the rich text control. Only problem is is that the margins are ignored on screen and when printing. How can I include the margins?
 
I've been struggling with this same issue for quite some time, and finally stumbled over a solution (at least for me) in another forum. If all you need to do is give the APPEARANCE of a margin, try this:
Put your rich text control on top of a TPanel. Make the panel the same color as the rich text control, set the Rich Text control's align property to alClient, and set the borderstyle for both components to None. Set the border for the panel to whatever width you want the "margin" to be.
Hope this helps.
Mary
 
Hi corneasd,

I found this line of code in the Delphi Help file
(under alignment).

Left:
richedit1.Paragraph.alignment:= taleftjustify;

Center:
richedit1.Paragraph.alignment:= tacenter;

Right:
richedit1.Paragraph.alignment:= tarigthjustify.
Ken Christensen
Kenman@Macrotech.dk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top