Добавил:
при поддержке музыки группы Anacondaz Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Курсовая работа.docx
Скачиваний:
30
Добавлен:
06.04.2022
Размер:
5.94 Mб
Скачать

Приложение б

Abibl.h:

using namespace System;

using namespace System::Drawing;

using namespace System::ComponentModel;

using namespace System::Collections;

using namespace System::Windows::Forms;

using namespace System::Data;

using namespace Microsoft::VisualBasic;

using namespace OleDb;

using namespace System::Data::OleDb;

using namespace Microsoft::Office::Interop;

using namespace System::IO;

namespace Abibl {

public ref class Class1

{

public:

void Vivod(double c, TextBox^ t);

void output_mass(int* mas, int len, DataGridView^ grid);

void zapis(DataGridView^ grid);

static void ZapisWord(int len, DataGridView^ dgv);

static void Add_Log_Password(TextBox^ Login, TextBox^ Password);

static bool Check_Log_Password(TextBox^ Login, TextBox^ Password);

static void create_file();

static void structure();

static void add_zap();

static bool v1(TextBox^ textBox1);

static bool v2(RadioButton^ r1, RadioButton^ r2, RadioButton^ r3, RadioButton^ r4);

static bool v3(CheckBox^ c1, CheckBox^ c2, CheckBox^ c3, CheckBox^ c4);

static bool v4(RadioButton^ r1, RadioButton^ r2, RadioButton^ r3, RadioButton^ r4);

static bool v5(TextBox^ t);

static bool v6(CheckBox^ c1, CheckBox^ c2, CheckBox^ c3, CheckBox^ c4);

static bool v7(ListBox^ l1, ListBox^ l2, ListBox^ l3);

static bool v8(ListBox^ l1, ListBox^ l2, ListBox^ l3);

static bool v9(TrackBar^ t);

static bool v10(ComboBox^ c1, ComboBox^ c2);

static bool v11(ComboBox^ c1, ComboBox^ c2, ComboBox^ c3);

static bool v12(TrackBar^ t);

static bool v13(HScrollBar^ h);

static bool v14(HScrollBar^ h);

static bool v15(CheckedListBox^ c);

static int* ans = new int[16];

static int n = 0;

static int correct = 0, wrong = 0;

void Output_result(int* ans, int n, DataGridView^ dgv);

};

}

Код элемента TextBox:

#pragma endregion

private: System::Void MyForm1_Load(System::Object^ sender, System::EventArgs^ e)

{

}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if (textBox1->Text == "")

{

MessageBox::Show("Вы не можете продолжить прохождение теста, пока не ответите на вопрос", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

}

else

{

if ((textBox1->Text == "Корпоративная сеть") || (textBox1->Text == "корпоративная сеть"))

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct +1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MessageBox::Show("Ответ" + cl->ans[16]);

MyForm2^ gform1 = gcnew MyForm2;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm2^ gform1 = gcnew MyForm2;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

};

}

#pragma endregion

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if (textBox1->Text == "")

{

MessageBox::Show("Вы не можете продолжить прохождение теста, пока не ответите на вопрос", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

}

else

{

if ((textBox1->Text == "Технология Т1") || (textBox1->Text == "Т1") || (textBox1->Text == "t1") || (textBox1->Text == "технология Т1") || (textBox1->Text == "технология t1"))

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm6^ gform1 = gcnew MyForm6;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили неверно", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm6^ gform1 = gcnew MyForm6;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

};

}

Код элемента RadioButton:

#pragma endregion

private: System::Void radioButton4_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {

}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if ((!radioButton1->Checked) && (!radioButton2->Checked) && (!radioButton3->Checked) && (!radioButton1->Checked))

{

MessageBox::Show("Вы не выбрали ответ!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

}

else

{

if (radioButton1->Checked)

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm3^ gform1 = gcnew MyForm3;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if (radioButton2->Checked)

{

MessageBox::Show("Вы ответили не верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm3^ gform1 = gcnew MyForm3;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if (radioButton3->Checked)

{

MessageBox::Show("Вы ответили не верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm3^ gform1 = gcnew MyForm3;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if (radioButton4->Checked)

{

MessageBox::Show("Вы ответили не верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm3^ gform1 = gcnew MyForm3;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

#pragma endregion

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if ((!radioButton1->Checked) && (!radioButton2->Checked) && (!radioButton3->Checked) && (!radioButton1->Checked))

{

MessageBox::Show("Вы не выбрали ответ!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

}

else

{

if (radioButton3->Checked)

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm5^ gform1 = gcnew MyForm5;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if (radioButton1->Checked)

{

MessageBox::Show("Вы ответили не верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm5^ gform1 = gcnew MyForm5;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if (radioButton2->Checked)

{

MessageBox::Show("Вы ответили не верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm5^ gform1 = gcnew MyForm5;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if (radioButton4->Checked)

{

MessageBox::Show("Вы ответили не верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm5^ gform1 = gcnew MyForm5;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

}

}

}

};

}

Код элемента CneckBox:

#pragma endregion

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if ((checkBox1->Checked != true) && (checkBox2->Checked != true) && (checkBox3->Checked != true) && (checkBox4->Checked != true))

{

MessageBox::Show("Вы не ответили!");

}

else

{

if ((checkBox1->Checked == true) && (checkBox2->Checked == false) && (checkBox3->Checked == false) && (checkBox4->Checked == true))

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == true) && (checkBox2->Checked == true) && (checkBox3->Checked == false) && (checkBox4->Checked == false))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == true) && (checkBox2->Checked == false) && (checkBox3->Checked == false) && (checkBox4->Checked == false))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == true) && (checkBox2->Checked == true) && (checkBox3->Checked == true) && (checkBox4->Checked == false))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == false) && (checkBox2->Checked == true) && (checkBox3->Checked == false) && (checkBox4->Checked == false))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == false) && (checkBox2->Checked == true) && (checkBox3->Checked == true) && (checkBox4->Checked == false))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == false) && (checkBox2->Checked == true) && (checkBox3->Checked == true) && (checkBox4->Checked == true))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == false) && (checkBox2->Checked == false) && (checkBox3->Checked == true) && (checkBox4->Checked == true))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == true) && (checkBox2->Checked == false) && (checkBox3->Checked == true) && (checkBox4->Checked == false))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == false) && (checkBox2->Checked == true) && (checkBox3->Checked == false) && (checkBox4->Checked == true))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == true) && (checkBox2->Checked == true) && (checkBox3->Checked == true) && (checkBox4->Checked == true))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == false) && (checkBox2->Checked == false) && (checkBox3->Checked == false) && (checkBox4->Checked == true))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

if ((checkBox1->Checked == false) && (checkBox2->Checked == false) && (checkBox3->Checked == true) && (checkBox4->Checked == false))

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm4^ gform1 = gcnew MyForm4;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

}

}

#pragma endregion

private: System::Void groupBox1_Enter(System::Object^ sender, System::EventArgs^ e) {

}

private: System::Void checkBox4_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {

}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if ((checkBox1->Checked!=true) && (checkBox2->Checked!=true) && (checkBox3->Checked!=true) && (checkBox4->Checked!=true))

{

MessageBox::Show("Вы не ответили!", "Ошибка", MessageBoxButtons::OK, MessageBoxIcon::Information);

}

else

{

if ((checkBox1->Checked == true) && (checkBox2->Checked == true) && (checkBox3->Checked == false) && (checkBox4->Checked == false))

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm7^ gform1 = gcnew MyForm7;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили не верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm7^ gform1 = gcnew MyForm7;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

};

}

Код элемента ListBox:

#pragma endregion

private: System::Void MyForm7_Load(System::Object^ sender, System::EventArgs^ e)

{

array<System::Object^>^ b = gcnew array<System::Object^>(4);

b[0] = ("прикладной");

b[1] = ("представительский");

b[2] = ("сеансовый");

for (int i = 0; i < 3; i++)

{

listBox1->Items->Add(b[i]);

}

}

private: System::Void button2_Click_1(System::Object^ sender, System::EventArgs^ e)

{

if (listBox1->SelectedIndex == 0)

{

listBox2->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(0);

}

else if (listBox1->SelectedIndex == 1)

{

listBox2->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(1);

}

else if (listBox1->SelectedIndex == 2)

{

listBox2->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(2);

}

else if (listBox1->SelectedIndex == 3)

{

listBox2->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(3);

}

else if (listBox3->SelectedIndex == 0)

{

listBox2->Items->Add(Convert::ToString(listBox3->SelectedItem));

listBox3->Items->RemoveAt(0);

}

else if (listBox4->SelectedIndex == 0)

{

listBox2->Items->Add(Convert::ToString(listBox4->SelectedItem));

listBox4->Items->RemoveAt(0);

}

}

private: System::Void button3_Click_1(System::Object^ sender, System::EventArgs^ e)

{

if (listBox1->SelectedIndex == 0)

{

listBox3->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(0);

}

else if (listBox1->SelectedIndex == 1)

{

listBox3->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(1);

}

else if (listBox1->SelectedIndex == 2)

{

listBox3->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(2);

}

else if (listBox1->SelectedIndex == 3)

{

listBox3->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(3);

}

else if (listBox2->SelectedIndex == 0)

{

listBox3->Items->Add(Convert::ToString(listBox2->SelectedItem));

listBox2->Items->RemoveAt(0);

}

else if (listBox4->SelectedIndex == 0)

{

listBox3->Items->Add(Convert::ToString(listBox4->SelectedItem));

listBox4->Items->RemoveAt(0);

}

}

private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e)

{

if (listBox1->SelectedIndex == 0)

{

listBox4->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(0);

}

else if (listBox1->SelectedIndex == 1)

{

listBox4->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(1);

}

else if (listBox1->SelectedIndex == 2)

{

listBox4->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(2);

}

else if (listBox1->SelectedIndex == 3)

{

listBox4->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(3);

}

else if (listBox2->SelectedIndex == 0)

{

listBox4->Items->Add(Convert::ToString(listBox2->SelectedItem));

listBox2->Items->RemoveAt(0);

}

else if (listBox3->SelectedIndex == 0)

{

listBox4->Items->Add(Convert::ToString(listBox3->SelectedItem));

listBox3->Items->RemoveAt(0);

}

}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if ((listBox2->Items->Count == 0) || (listBox3->Items->Count == 0) || (listBox4->Items->Count == 0))

{

MessageBox::Show("Вы не ответили на вопрос!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

}

else

{

if ((listBox2->Items[0] == "прикладной") && (listBox3->Items[0] == "представительский") && (listBox4->Items[0] == "сеансовый"))

{

MessageBox::Show("Вы ответили верно", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm8^ gform1 = gcnew MyForm8;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили неверно", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm8^ gform1 = gcnew MyForm8;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

};

}

#pragma endregion

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if ((listBox2->Items->Count == 0) || (listBox3->Items->Count == 0))

{

MessageBox::Show("Вы не ответили на вопрос!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

}

else

{

if ((listBox2->Items[0] == "ATM") && (listBox3->Items[0] == "ISDN"))

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm9^ gform1 = gcnew MyForm9;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили не верно", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm9^ gform1 = gcnew MyForm9;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

private: System::Void MyForm8_Load(System::Object^ sender, System::EventArgs^ e)

{

array<System::Object^>^ b = gcnew array<System::Object^>(4);

b[0] = ("ATM");

b[1] = ("ISDN");

b[2] = ("B#ISDN");

for (int i = 0; i < 3; i++)

{

listBox1->Items->Add(b[i]);

}

}

private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e)

{

if (listBox1->SelectedIndex == 0)

{

listBox2->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(0);

}

else if (listBox1->SelectedIndex == 1)

{

listBox2->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(1);

}

else if (listBox1->SelectedIndex == 2)

{

listBox2->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(2);

}

else if (listBox1->SelectedIndex == 3)

{

listBox2->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(3);

}

else if (listBox3->SelectedIndex == 0)

{

listBox2->Items->Add(Convert::ToString(listBox3->SelectedItem));

listBox3->Items->RemoveAt(0);

}

else if (listBox4->SelectedIndex == 0)

{

listBox2->Items->Add(Convert::ToString(listBox4->SelectedItem));

listBox4->Items->RemoveAt(0);

}

}

private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e)

{

if (listBox1->SelectedIndex == 0)

{

listBox3->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(0);

}

else if (listBox1->SelectedIndex == 1)

{

listBox3->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(1);

}

else if (listBox1->SelectedIndex == 2)

{

listBox3->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(2);

}

else if (listBox1->SelectedIndex == 3)

{

listBox3->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(3);

}

else if (listBox2->SelectedIndex == 0)

{

listBox3->Items->Add(Convert::ToString(listBox2->SelectedItem));

listBox2->Items->RemoveAt(0);

}

else if (listBox4->SelectedIndex == 0)

{

listBox3->Items->Add(Convert::ToString(listBox4->SelectedItem));

listBox4->Items->RemoveAt(0);

}

}

private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e)

{

if (listBox1->SelectedIndex == 0)

{

listBox4->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(0);

}

else if (listBox1->SelectedIndex == 1)

{

listBox4->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(1);

}

else if (listBox1->SelectedIndex == 2)

{

listBox4->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(2);

}

else if (listBox1->SelectedIndex == 3)

{

listBox4->Items->Add(Convert::ToString(listBox1->SelectedItem));

listBox1->Items->RemoveAt(3);

}

else if (listBox2->SelectedIndex == 0)

{

listBox4->Items->Add(Convert::ToString(listBox2->SelectedItem));

listBox2->Items->RemoveAt(0);

}

else if (listBox3->SelectedIndex == 0)

{

listBox4->Items->Add(Convert::ToString(listBox3->SelectedItem));

listBox3->Items->RemoveAt(0);

}

}

private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e)

{

}

private: System::Void button6_Click(System::Object^ sender, System::EventArgs^ e)

{

}

private: System::Void button7_Click(System::Object^ sender, System::EventArgs^ e)

{

}

};

}

Код элемента TrackBar:

#pragma endregion

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if (trackBar1->Value == 1)

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm10^ gform1 = gcnew MyForm10;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили не верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm10^ gform1 = gcnew MyForm10;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

private: System::Void trackBar1_Scroll(System::Object^ sender, System::EventArgs^ e)

{

}

};

}

#pragma endregion

private: System::Void label3_Click(System::Object^ sender, System::EventArgs^ e) {

}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if (trackBar1->Value == 4)

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm13^ gform1 = gcnew MyForm13;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили не верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm13^ gform1 = gcnew MyForm13;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

};

}

Код элемента ComboBox:

#pragma endregion

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if (comboBox1->SelectedIndex == -1)

{

MessageBox::Show("Вы не ответили на вопрос!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

}

else

{

if ((comboBox1->SelectedIndex == 3) && (comboBox2->SelectedIndex == 2))

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm11^ gform1 = gcnew MyForm11;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm11^ gform1 = gcnew MyForm11;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

};

}

#pragma endregion

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if (comboBox1->SelectedIndex == -1)

{

MessageBox::Show("Вы не ответили на вопрос!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

}

else

{

if ((comboBox1->SelectedIndex == 1) && (comboBox2->SelectedIndex == 1) && (comboBox3->SelectedIndex==1))

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm12^ gform1 = gcnew MyForm12;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm12^ gform1 = gcnew MyForm12;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

};

}

Код элемента HScrollBar:

#pragma endregion

private: System::Void hScrollBar1_Scroll(System::Object^ sender, System::Windows::Forms::ScrollEventArgs^ e)

{

label2->Text = ("Ваш ответ: " + Convert::ToInt32(hScrollBar1->Value));

}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if (hScrollBar1->Value == 1)

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm14^ gform1 = gcnew MyForm14;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm14^ gform1 = gcnew MyForm14;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

};

}

#pragma endregion

private: System::Void hScrollBar1_Scroll(System::Object^ sender, System::Windows::Forms::ScrollEventArgs^ e)

{

label2->Text = ("Ваш ответ: " + Convert::ToInt32(hScrollBar1->Value));

}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if (hScrollBar1->Value == 4)

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm15^ gform1 = gcnew MyForm15;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm15^ gform1 = gcnew MyForm15;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

};

}

Код элемента ChekedListBox:

#pragma endregion

private: System::Void checkedListBox1_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e)

{

}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if (checkedListBox1->SelectedItems->Count == 0)

{

MessageBox::Show("Вы не ответили на вопрос", "Вопрос №16", MessageBoxButtons::OK, MessageBoxIcon::Error);

}

else

{

if ((checkedListBox1->CheckedIndices->Contains(0)) && (checkedListBox1->CheckedIndices->Contains(1)) && (checkedListBox1->CheckedIndices->Contains(2)) && (checkedListBox1->CheckedIndices->Contains(3)) && !(checkedListBox1->CheckedIndices->Contains(4)))

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm16^ gform1 = gcnew MyForm16;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm16^ gform1 = gcnew MyForm16;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

private: System::Void MyForm15_Load(System::Object^ sender, System::EventArgs^ e)

{

array<System::Object^>^ b = gcnew array<System::Object^>(5);

b[0] = ("Шина");

b[1] = ("Снежинка");

b[2] = ("Дерево");

b[3] = ("Кольцо");

b[4] = ("Морской узел");

for (int i = 0; i < 5; i++)

{

checkedListBox1->Items->Add(b[i]);

}

}

};

}

#pragma endregion

private: System::Void MyForm16_Load(System::Object^ sender, System::EventArgs^ e)

{

array<System::Object^>^ b = gcnew array<System::Object^>(2);

b[0] = ("Да");

b[1] = ("Нет");

for (int i = 0; i < 2; i++)

{

checkedListBox1->Items->Add(b[i]);

}

}

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)

{

Abibl::Class1^ cl = gcnew Abibl::Class1();

if (checkedListBox1->SelectedItems->Count == 0)

{

MessageBox::Show("Вы не ответили на вопрос", "Вопрос №16", MessageBoxButtons::OK, MessageBoxIcon::Error);

}

else

{

if ((checkedListBox1->CheckedIndices->Contains(0)) || (checkedListBox1->CheckedIndices->Contains(1)))

{

MessageBox::Show("Вы ответили верно!", "", MessageBoxButtons::OK, MessageBoxIcon::Information);

int rez = 1;

cl->correct = cl->correct + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm17^ gform1 = gcnew MyForm17;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

else

{

MessageBox::Show("Вы ответили неверно!", "", MessageBoxButtons::OK, MessageBoxIcon::Error);

//Abibl::Class1^ cl = gcnew Abibl::Class1();

int rez = 0;

cl->wrong = cl->wrong + 1;

cl->ans[cl->n] = rez;

cl->n = cl->n + 1;

MyForm17^ gform1 = gcnew MyForm17;

gform1->Show();

gform1->Owner = this;

this->Hide();

gform1->Visible = true;

}

}

}

};

}