Код:
1 2 3 4 5 6 7 8 9 10 | procedure TForm3 . Button1Click(Sender: TObject);
begin
If ListBox1 . Count= 6 then Showmessage( 'максимум 6!!!' )
else
begin
ListBox1 . Items[ListBox1 . Items . Count]:=Edit1 . Text;
Edit1 . Text:= '' ;
Edit1 . SetFocus;
end ;
end ;
|
Вот почему когда добавляю в листбокс строку из эдита все норм получается, а вот когда в чеклистбокс то выпадает ошибка: Project Project.exe raised exception class EListError with message 'List index out of bounds (0)'. Process stoped. Use Step or Run to continue.
Код:
1 2 3 4 5 6 7 8 9 10 | procedure TForm3 . Button3Click(Sender: TObject);
begin
If CheckListBox1 . Items . Count= 6 then Showmessage( 'Максимум 6 вариантов!!!' )
else
begin
CheckListBox1 . Items[CheckListBox1 . Count]:=Edit1 . Text;
Edit4 . Text:= '' ;
Edit4 . SetFocus;
end ;
end ;
|
Админ: Пользуемся тегами для оформления кода!
Помогите пожалуйста люди добрые, из-за такой херни курсач накрывается!!!