Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete rows in a listview using DeleteKey

Status
Not open for further replies.

sanjna000

Programmer
Aug 1, 2003
132
GB
Hi,

Does any one know how to delete rows in a listview by using delete key in the key board?

Thank you very much for u r help in advance.

Sanjna...
 
Add an OnKeyUp event like:

procedure TForm1.ListView1KeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if(Key=vk_Delete)then
with (Sender as TListView)do
if(ItemFocused<>nil)then
ItemFocused.Delete;
end;

Have fun
Simon
 
Hi Simon,
Thank you soooooooo much for u r help. It works nicely.

Thanks again,
Sanjna...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top