SRichViewEdit Header

General TRichView support forum. Please post your questions here
Post Reply
rellik
Posts: 18
Joined: Mon Oct 05, 2015 9:17 am

SRichViewEdit Header

Post by rellik »

How I can to restrict editing header of TSRishViewEdit?
rellik
Posts: 18
Joined: Mon Oct 05, 2015 9:17 am

Post by rellik »

answer to myself:

SrishViewEdit.RVHeader.ReadOnly:=true.

And another question to Sergey: May I show header only on the first page?
rellik
Posts: 18
Joined: Mon Oct 05, 2015 9:17 am

Post by rellik »

I mush have header only on the firsp page, and can't edit them. It is possible?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Post Reply