Hello,
I want to use the same button to make insertPageBreak and RemoveCurrentPageBreak.
I don't kow how I have to ask in an IF ... else part.
Jürgen
memo.InsertPageBreak and memo.RemoveCurrentPageBreak
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Code: Select all
var ItemNo: Integer;
PB: Boolean;
begin
if memo.InplaceEditor<>nil then
exit; // do not add page breaks in table cells
ItemNo := memo.CurItemNo;
if memo.OffsetInCurItem > memo.GetOffsBeforeItem(ItemNo) then
PB := False // we are not at the beginning of item,
// so we are not at the beginning of paragraph
else begin
if (ItemNo>0) and (memo.GetItemStyle(ItemNo-1)=rvsListMarker) then
dec(ItemNo);
PB := memo.PageBreaksBeforeItems[ItemNo];
end;
if PB then
memo.RemoveCurrentPageBreak
else
memo.InsertPageBreak;
end;