procedure TForm1.SpeedButton2Click(Sender: TObject);
var anterior String;
begin
anterior := '';
with ListBox2.Items do
begin
if ListBox2.ItemIndex < Count-1 then begin
ListBox2.ItemIndex := ListBox2.ItemIndex + 1
if (ListBox2.items[ListBox2.itemindex] <> anterior) and
(anterior <> '') then
showmessage('cambio');
anterior := ListBox2.items[ListBox2.itemindex];
end
else MessageDlg(Final del curso !',mtInformation,[mbOk],0);
end;