function ListBox1_Dlt_Select(var NowCount: Integer;NowListBox:TListBox): Integer;
var
I:Integer;
begin
for i:=0 to NowCount do
if NowListBox.Selected[i] then
begin
NowListBox.Items.Delete(i);
NowCount := NowCount - 1;
ListBox1_Dlt_Select(NowCount,NowListBox);
Exit;
end;
end;
procedure TMainFrm.LotNo5Click(Sender: TObject);
var
NowCount:Integer;
NowListBox:TListBox;
begin
NowListBox := ListBox1;
NowCount := ListBox1.Items.Count - 1;
ListBox1_Dlt_Select(NowCount,NowListBox);
end;