#apptype windows
#reference
'System.Windows.Forms.dll'
#reference
'System.Drawing.dll'
uses
system, System
.
Windows
.
Forms;
var
pr:=
0
;
otv:System
.
Windows
.
Forms
.
Button;
st: System
.
Windows
.
Forms
.
Button;
MyForm: System
.
Windows
.
Forms
.
Form;
But: System
.
Windows
.
Forms
.
Button;
Lab: System
.
Windows
.
Forms
.
Label
;
Lab2: System
.
Windows
.
Forms
.
Label
;
Rad1: System
.
Windows
.
Forms
.
RadioButton; <font color="#00ff00"> \\Описание переключателей</font>
Rad2: System
.
Windows
.
Forms
.
RadioButton; <font color="#00ff00"> \\Описание переключателей</font>
Rad3: System
.
Windows
.
Forms
.
RadioButton; <font color="#00ff00">\\Описание переключателей</font>
Rad4: System
.
Windows
.
Forms
.
RadioButton; <font color="#00ff00">\\Описание переключателей</font>
\\ Процедура создания второго вопроса
Procedure
ButtonClick2(sender:
object
; e: EventArgs);
begin
Lab2
.
Show;
Lab2
.
Text:=IntToStr(pr); <font color="Lime">\\ Должен вывести переменную (pr), но не зависимо от выбора ответа, записывает
0
.</font>
lab
.
Text:=
'Вопрос 2'
;
Rad1
.
Text:=
'1'
;
Rad2
.
Text:=
'2'
;
Rad3
.
Text:=
'3'
;
Rad4
.
Text:=
'4'
;
end
;
<font color="Lime">\\ Процедура создания первого вопроса</font>
Procedure
ButtonClick(sender:
object
; e: EventArgs);
begin
But
.
Show;
st
.
Hide;
otv
.
Hide;
Lab
.
Show;
Rad1
.
Show;
Rad2
.
Show;
Rad3
.
Show;
Rad4
.
Show;
Lab
.
Text:=
'Вопрос 1'
;
Rad1
.
Text:=
'1'
;
Rad2
.
Text:=
'2'
;
Rad3
.
Text:=
'3'
;
Rad4
.
Text:=
'4'
;
If
Rad2
.
Checked=
true
then
<font color="#00ff00">\\Если выбран второй переклчатель, то</font>
pr:=pr+
1
; <font color="#00ff00">\\Присвоить переменной +
1
</font>
But
.
Click+=ButtonClick2 <font color="#00ff00"> \\Переходим к процедуре второго вопроса</font>
end
;
begin
<font color="#00ff00">\\Тело создания формы </font>
begin
pr:=
0
; <font color="#00ff00">\\Присваиваем pr значение
0
</font>
MyForm := System
.
Windows
.
Forms
.
Form
.
Create;
MyForm
.
text :=
'Форма'
;
MyForm
.
Height :=
400
;
MyForm
.
Width :=
600
;
St:=new Button;
St
.
Text:=
'Начать тест'
;
St
.
Width:=
200
;
St
.
Height:=
100
;
St
.
Left:=
200
;
St
.
Top:=
100
;
MyForm
.
Controls
.
Add(St);
But := new Button;
But
.
Text :=
'Далее'
;
But
.
Width:=
100
;
But
.
Left :=
450
;
But
.
Top :=
300
;
But
.
Hide;
MyForm
.
Controls
.
Add(But);
Lab:=System
.
Windows
.
Forms
.
Label
.
Create;
Lab
.
text:=
'11111'
;
Lab
.
Left:=
50
;
Lab
.
Top:=
20
;
Lab
.
Width:=
500
;
Lab
.
Height:=
50
;
Lab
.
Hide;
MyForm
.
Controls
.
Add(Lab);
<font color="#00ff00">\\Создание переключателя №
1
</font>
Rad1:=System
.
Windows
.
Forms
.
RadioButton
.
Create;
Rad1
.
Width:=
200
;
Rad1
.
Text:=
'1 ответ//////////////////'
;
Rad1
.
Left:=
100
;
Rad1
.
Top:=
70
;
Rad1
.
Hide;
MyForm
.
Controls
.
Add(Rad1);
<font color="#00ff00">\\Создание переключателя №
2
</font>
Rad2:=System
.
Windows
.
Forms
.
RadioButton
.
Create;
Rad2
.
Width:=
200
;
Rad2
.
Text:=
'1 ответ//////////////////'
;
Rad2
.
Left:=
100
;
Rad2
.
Top:=
100
;
Rad2
.
Hide;
MyForm
.
Controls
.
Add(Rad2);
<font color="#00ff00">\\Создание переключателя №
3
</font>
Rad3:=System
.
Windows
.
Forms
.
RadioButton
.
Create;
Rad3
.
Width:=
200
;
Rad3
.
Text:=
'1 ответ//////////////////'
;
Rad3
.
Left:=
100
;
Rad3
.
Top:=
130
;
Rad3
.
Hide;
MyForm
.
Controls
.
Add(Rad3);
<font color="#00ff00">\\Создание переключателя №
4
</font>
Rad4:=System
.
Windows
.
Forms
.
RadioButton
.
Create;
Rad4
.
Width:=
200
;
Rad4
.
Text:=
'1 ответ//////////////////'
;
Rad4
.
Left:=
100
;
Rad4
.
Top:=
160
;
Rad4
.
Hide;
MyForm
.
Controls
.
Add(Rad4);
otv:=new Button;
otv
.
Left:=
400
;
otv
.
Top:=
200
;
otv
.
Text:=
'Выбрать'
;
otv
.
Hide;
MyForm
.
Controls
.
Add(otv);
Lab2:= System
.
Windows
.
Forms
.
Label
.
Create;
Lab2
.
Width:=
200
;
Lab2
.
Height:=
100
;
Lab2
.
Left:=
350
;
Lab2
.
Top:=
80
;
Lab2
.
Text:=
'fffffffffff'
;
Lab2
.
Hide;
MyForm
.
Controls
.
Add(Lab2);
begin
St
.
Click += ButtonClick; <font color="#00ff00">\\ Переходим к процедуре первого вопроса</font>
end
;
end
;
begin
Application
.
Run(MyForm)
end
;
end
.