How is it possible to remove the Last line of text that has been added in a TRichView?
I need this last line to be removed as I am using it as an Invalid Password Log and when the Good Password is entered this should be removed from RichView before being displayed.
Many thanks
jnap
How to delete Very Last line added in TRichView?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
To delete the last item, call
DeleteItems may produce incorrect documents (See "Valid Documents" in the help file). If the last paragraph is bulleted/numbered and contains only one item after the list marker, the code above produces incorrect document.
To delete the last paragraph, call
Calling Format is not necessary, but it is required that the document is formatted before calling DeleteParas.
Code: Select all
rv.DeleteItems(rv.ItemCount-1, 1).
rv.Format;
To delete the last paragraph, call
Code: Select all
rv.DeleteParas(rv.ItemCount-1, rv.ItemCount-1);