I want to set the paragraph at left,center,or right.but it changed must after press a Keyword or the mouse press on it.Could you get me some advice. The codes are following:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if(Sender == Button1)
RVStyle1->ParaStyles->Items[RichViewEdit1->CurParaStyleNo ]->Alignment = rvaLeft;
if(Sender == Button2)
RVStyle1->ParaStyles->Items[RichViewEdit1->CurParaStyleNo ]->Alignment = rvaCenter;
if(Sender == Button3)
RVStyle1->ParaStyles->Items[RichViewEdit1->CurParaStyleNo ]->Alignment = rvaRight;
}
Thank you!
set the paragraph at left,center,or right
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
This code is not correct.
It changes properties of the current paragraph style. But this style may be used not only by the current paragraph, but by other paragraphs too.
And these changes become visible only after document reformatting.
And these changes cannot be undone/redone by user.
You should use ApplyParaStyleConversion method and OnParaStyleConversion event.
See the demo in
Demos\CBuilder\Editors\Editor 2\
It changes properties of the current paragraph style. But this style may be used not only by the current paragraph, but by other paragraphs too.
And these changes become visible only after document reformatting.
And these changes cannot be undone/redone by user.
You should use ApplyParaStyleConversion method and OnParaStyleConversion event.
See the demo in
Demos\CBuilder\Editors\Editor 2\