Page 1 of 1

SRichViewEdit Header

Posted: Sat Nov 07, 2015 11:40 am
by rellik
How I can to restrict editing header of TSRishViewEdit?

Posted: Sat Nov 07, 2015 12:21 pm
by rellik
answer to myself:

SrishViewEdit.RVHeader.ReadOnly:=true.

And another question to Sergey: May I show header only on the first page?

Posted: Sat Nov 07, 2015 12:49 pm
by rellik
I mush have header only on the firsp page, and can't edit them. It is possible?

Posted: Sat Nov 07, 2015 5:55 pm
by Sergey Tkachenko
Special header and footer for the first page are added if SRV.PageProperty.TitlePage := True

An alternative solution for making header/footer readonly.
Process OnChangeActiveEditor event:

Code: Select all

procedure TForm1.SRichViewEdit1ChangeActiveEditor(Sender: TSRichViewEdit; ActiveEditor: TRichViewEdit);
begin
  if (ActiveEditor=Sender.RVHeader) or (ActiveEditor=Sender.RVFooter) or
    ((ActiveEditor=Sender.RVNote) and (Sender.CurrentNoteParentEditor<>Sender.RichViewEdit)) then
  Sender.StartEditing(srvrveMain);
end;
This code disallows placing the caret in a header and a footer.