Не могу понять где ошибка. Вот код unit Unit16; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, - вопрос №4602682

System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TForm16 = class(TForm) CheckBox1: TCheckBox; CheckBox2: TCheckBox; CheckBox3: TCheckBox; CheckBox4: TCheckBox; CheckBox5: TCheckBox; Label1: TLabel; procedure FormCreate(Sender: TObject); procedure CheckBox1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form16: TForm16; implementation {$R *.dfm} var s:boolean; procedure TForm16.CheckBox1Click(Sender: TObject); var Index, i, num: Integer; var e: Boolean; begin if s then Exit; s := True; for Index:= 0 to 4 do if Sender = Controls[i] then break; if not (Controls[Index] as TCheckBox).Checked then (Controls[Index] as TCheckBox).Checked := True else begin num := Index + 1; if Index = 4 then num := 0; //(Controls[num] as TCheckBox).Checked := not (Controls[num] as CheckBox1).Checked; num := num + 1; if Index = 3 then num := 0; //(Controls[num] as TCheckBox).Checked := not (Controls[num] as CheckBox1).checked; end; e := True; for i := 0 to 4 do e := e and (Controls[i] as TCheckBox).Checked; if e then for i := 0 to 4 do begin (Controls[i] as TCheckBox).Caption := 'Победа!'; (Controls[i] as TCheckBox).Enabled := False; end; s := False; end; procedure TForm16.FormCreate(Sender: TObject); begin s := False; end; end.
09.01.22
0 ответов
Ответов пока нет
Посмотреть всех экспертов из раздела Технологии > Delphi
Пользуйтесь нашим приложением Доступно на Google Play Загрузите в App Store