How To Set Default Alignment In TRichViewEdit

General TRichView support forum. Please post your questions here
Post Reply
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

How To Set Default Alignment In TRichViewEdit

Post by DickBryant »

I would like to know how to set the default alignment of a TRichViewEdit that I'm using as an editor so that it would force, say, centered alignment UNLESS the paragraph was specifically set to something else.

This setting would be set elsewhere in a global options dialog. So what I'm looking for is something like:

RVEdit1.DefaultAlignment := Alignment;

where alignment is rvaLeft, rvaRight, rvaCenter or rvaJustify

So when the rve is cleared and someone begins typing into the editor it would start off being in the default alignment, but could then be selected and changed by regular means.

Thanks,

Dick
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If you want to change initial alignment, it's simple.

On clearing:

rve.Clear;
rve.DeleteUnusedStyles(True, True, True);
rve.ParaStyles[0].Alignment := DefaultAlignment;
DickBryant
Posts: 148
Joined: Wed Dec 07, 2005 2:02 pm
Contact:

Post by DickBryant »

Thanks! Just what I was looking for!
Post Reply