Board index » delphi » Deleting a Tlistview item by pressing Delete key

Deleting a Tlistview item by pressing Delete key

Hi
Ive a TListView with view set to report mode with a single column.
I want the user to be able to delete an item by pressing the Delete key.
I can do this by trapping the OnKeyUp event and checking for key = vk_delete
.
My problem is that I only want the Delete key to delete the item when the
item is not in Editing mode ie the item should be selected but there should
be no caret in the view.
How do I check which mode the list item is in please?

--
Claire Humphrey
Software Engineer

 

Re:Deleting a Tlistview item by pressing Delete key


Solved it - was looking at the properties for an item rather than the
TListView itself. Thanx anyway

--
Claire Humphrey
Software Engineer

Quote
"Claire" <claire.humph...@hipotronics.co.uk> wrote in message

news:3c96072b_2@dnews...
Quote
> Hi
> Ive a TListView with view set to report mode with a single column.
> I want the user to be able to delete an item by pressing the Delete key.
> I can do this by trapping the OnKeyUp event and checking for key =
vk_delete
> .
> My problem is that I only want the Delete key to delete the item when the
> item is not in Editing mode ie the item should be selected but there
should
> be no caret in the view.
> How do I check which mode the list item is in please?

> --
> Claire Humphrey
> Software Engineer

Other Threads