How to delete a checkpoint

General TRichView support forum. Please post your questions here
Post Reply
mihoum
Posts: 5
Joined: Tue Apr 14, 2009 3:59 pm

How to delete a checkpoint

Post by mihoum »

I try to use the RemoveCheckpoint method and doesn't work for me.
I have added a “Delete checkpoint” button in your demo project Tutorial_2_3 under the listbox with checkpoints.
There is code Onclick for this button:
srv.RichViewEdit.RemoveCheckPoint(ListBox1.ItemIndex);
It does nothing. The checkpoint stays as is, I can go to it again.

Thanks.
Sergey Tkachenko
Site Admin
Posts: 17499
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

RemoveCheckPoint wants an index of an item containing the checkpoint.
ListBox1.ItemIndex is an index of the checkpoint itself, not of its item.
The following code must work:

Code: Select all

with srv.RichViewEdit do
  RemoveCheckPoint(GetCheckpointItemNo(GetCheckpointByNo(ListBox1.ItemIndex)));
mihoum
Posts: 5
Joined: Tue Apr 14, 2009 3:59 pm

Post by mihoum »

It works.

Thank you.
Post Reply