Page 1 of 1
Detecting selection deletion
Posted: Fri Mar 03, 2006 10:01 pm
by aoven
Is there a clever way of detecting a selection deletion before it occurs?
Aleksander
Posted: Fri Mar 03, 2006 10:26 pm
by aoven
Actually, I just found out that OnItemAction event is close enough for my needs. It can catch every item before it gets deleted or cut.
Aleksander
Posted: Sat Mar 04, 2006 11:25 am
by Sergey Tkachenko
Just take into account:
1) Item may be deleted by Backspace or Delete key, even it it was not selected
2) If only part of item's text was selected, item is not deleted with the selection
Posted: Sat Mar 04, 2006 1:44 pm
by aoven
Hm, yes - those are both good points. But that can't happen with items that have style protection enabled, right? And it just so happens I only need to know when those items are being deleted. I don't care about the others.
Aleksander
Posted: Sat Mar 04, 2006 4:39 pm
by Sergey Tkachenko
If item is deleted only as a whole, then yes, OnItemAction can be used to detect it.