Property TWPCustomRtfEdit.TableAtEndOfCell : Boolean
Unit: WPCTRMemo
Class: WPCTRMemo.TWPCustomRtfEdit
Description
This property is true if the cursor is in a table cell and at the end of the cell. You can use it to create new table rows when the uses presses CR:
procedure TWPPremTest.WPRichText1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var aRow : TParagraph;
colnr : Integer;
begin
aRow := WPRichText1.TableRow;
if (Key=13) and (aRow<>nil) and WPRichText1.TableAtEndOfCell then
begin
colnr := WPRichText1.TableColNumber;
aRow := aRow.Duplicate(false, true, false, [wpParCopyStyleswpParCopyStyles,wpDontCopyCellSubParagaraphs]);
WPRichText1.ActiveParagraph := aRow.ColFirst;
WPRichText1.TableColNumber := colnr;
WPRichText1.ReformatAll(false, true);
Key := 0;
end;
end;