Смекни!
smekni.com

Структура иерархии классов "Экран курсового проектирования" (стр. 8 из 8)

this->Controls->Add(this->label20);

this->Controls->Add(this->label19);

this->Controls->Add(this->label18);

this->Controls->Add(this->label17);

this->Controls->Add(this->label16);

this->Controls->Add(this->label15);

this->Controls->Add(this->label14);

this->Controls->Add(this->label13);

this->Controls->Add(this->label12);

this->Controls->Add(this->label11);

this->Controls->Add(this->label10);

this->Controls->Add(this->label9);

this->Controls->Add(this->label8);

this->Controls->Add(this->label7);

this->Controls->Add(this->label6);

this->Controls->Add(this->label5);

this->Controls->Add(this->label4);

this->Controls->Add(this->label3);

this->Controls->Add(this->label2);

this->Controls->Add(this->label1);

this->Controls->Add(this->textBox17);

this->Controls->Add(this->button3);

this->Controls->Add(this->button2);

this->Controls->Add(this->button1);

this->Controls->Add(this->textBox16);

this->Controls->Add(this->textBox15);

this->Controls->Add(this->textBox14);

this->Controls->Add(this->textBox13);

this->Controls->Add(this->textBox12);

this->Controls->Add(this->textBox11);

this->Controls->Add(this->textBox10);

this->Controls->Add(this->textBox9);

this->Controls->Add(this->textBox8);

this->Controls->Add(this->textBox7);

this->Controls->Add(this->textBox6);

this->Controls->Add(this->textBox5);

this->Controls->Add(this->textBox4);

this->Controls->Add(this->textBox3);

this->Controls->Add(this->textBox2);

this->Controls->Add(this->textBox1);

this->HelpButton = true;

this->MaximizeBox = false;

this->MinimizeBox = false;

this->Name = L"Form2";

this->Text = L"Добавление студента";

this->ResumeLayout(false);

this->PerformLayout();

}

#pragma endregion

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

this->DialogResult=System::Windows::Forms::DialogResult::OK;

this->Close();

}

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

textBox1->Clear();

textBox2->Clear();

textBox3->Clear();

textBox4->Clear();

textBox5->Clear();

textBox6->Clear();

textBox7->Clear();

textBox8->Clear();

textBox9->Clear();

textBox10->Clear();

textBox11->Clear();

textBox12->Clear();

textBox13->Clear();

textBox14->Clear();

textBox15->Clear();

textBox16->Clear();

textBox17->Clear();

}

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

this->Close();

}

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

if(textBox1->Text!=""&&textBox2->Text!=""&&textBox3->Text!=""&&textBox4->Text!=""&&textBox5->Text!=""

&&textBox6->Text!=""&&textBox7->Text!=""&&textBox8->Text!=""

&&textBox9->Text!=""&&textBox10->Text!=""&&textBox11->Text!=""

&&textBox12->Text!=""&&textBox13->Text!=""&&textBox14->Text!=""

&&textBox15->Text!=""&&textBox16->Text!=""&&textBox17->Text!=""){

if(System::Char::IsDigit(textBox2->Text,0)&&System::Char::IsDigit(textBox3->Text,0)&&

System::Char::IsDigit(textBox4->Text,0)&&System::Char::IsDigit(textBox5->Text,0)&&

System::Char::IsDigit(textBox6->Text,0)&&System::Char::IsDigit(textBox7->Text,0)&&

System::Char::IsDigit(textBox8->Text,0)&&System::Char::IsDigit(textBox9->Text,0)&&

System::Char::IsDigit(textBox10->Text,0)&&System::Char::IsDigit(textBox17->Text,0)){

button1->Visible=true;

}

else{

MessageBox::Show("Некоторыеполяимеютневерныйформат!","Ошибка",MessageBoxButtons::OK,MessageBoxIcon::Error);

}

}

else{

MessageBox::Show("Незаполненынекоторыеполя!","Ошибка",MessageBoxButtons::OK,MessageBoxIcon::Error);

}

}

};

}

Файл Strart.h. Окно ввода информации об экране курсового проектирования.

#pragma once

namespace WindowsFormApplicationC {

using namespace System;

using namespace System::ComponentModel;

using namespace System::Collections;

using namespace System::Windows::Forms;

using namespace System::Data;

using namespace System::Drawing;

/// <summary>

/// Summary for Start

/// </summary>

public ref class Start : public System::Windows::Forms::Form

{

public:

Start(void)

{

InitializeComponent();

}

protected:

~Start()

{

if (components)

{

delete components;

}

}

public: System::Windows::Forms::TextBox^ textBox1;

protected:

private: System::Windows::Forms::Button^ button1;

public: System::Windows::Forms::TextBox^ textBox2;

private:

public: System::Windows::Forms::TextBox^ textBox3;

private: System::Windows::Forms::Label^ label1;

public:

private: System::Windows::Forms::Label^ label2;

private: System::Windows::Forms::Label^ label3;

private:

/// <summary>

/// Required designer variable.

/// </summary>

System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code

void InitializeComponent(void)

{

this->textBox1 = (gcnew System::Windows::Forms::TextBox());

this->button1 = (gcnew System::Windows::Forms::Button());

this->textBox2 = (gcnew System::Windows::Forms::TextBox());

this->textBox3 = (gcnew System::Windows::Forms::TextBox());

this->label1 = (gcnew System::Windows::Forms::Label());

this->label2 = (gcnew System::Windows::Forms::Label());

this->label3 = (gcnew System::Windows::Forms::Label());

this->SuspendLayout();

//

// textBox1

//

this->textBox1->Location = System::Drawing::Point(12, 34);

this->textBox1->Name = L"textBox1";

this->textBox1->Size = System::Drawing::Size(508, 20);

this->textBox1->TabIndex = 0;

//

// button1

//

this->button1->AutoEllipsis = true;

this->button1->Location = System::Drawing::Point(445, 172);

this->button1->Name = L"button1";

this->button1->Size = System::Drawing::Size(75, 23);

this->button1->TabIndex = 1;

this->button1->Text = L"OK";

this->button1->UseVisualStyleBackColor = true;

this->button1->Click += gcnew System::EventHandler(this, &Start::button1_Click);

//

// textBox2

//

this->textBox2->Location = System::Drawing::Point(12, 82);

this->textBox2->Name = L"textBox2";

this->textBox2->Size = System::Drawing::Size(508, 20);

this->textBox2->TabIndex = 2;

//

// textBox3

//

this->textBox3->Location = System::Drawing::Point(12, 130);

this->textBox3->Name = L"textBox3";

this->textBox3->Size = System::Drawing::Size(173, 20);

this->textBox3->TabIndex = 3;

//

// label1

//

this->label1->AutoSize = true;

this->label1->Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,

static_cast<System::Byte>(204)));

this->label1->Location = System::Drawing::Point(8, 105);

this->label1->Name = L"label1";

this->label1->Size = System::Drawing::Size(156, 21);

this->label1->TabIndex = 4;

this->label1->Text = L"Датаутверждения";

//

// label2

//

this->label2->AutoSize = true;

this->label2->Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,

static_cast<System::Byte>(204)));

this->label2->Location = System::Drawing::Point(8, 57);

this->label2->Name = L"label2";

this->label2->Size = System::Drawing::Size(235, 21);

this->label2->TabIndex = 5;

this->label2->Text = L"Составприемнойкомиссии";

//

// label3

//

this->label3->AutoSize = true;

this->label3->Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,

static_cast<System::Byte>(204)));

this->label3->Location = System::Drawing::Point(8, 9);

this->label3->Name = L"label3";

this->label3->Size = System::Drawing::Size(222, 21);

this->label3->TabIndex = 6;

this->label3->Text = L"Названиекурсовоголиста";

//

// Start

//

this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);

this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;

this->ClientSize = System::Drawing::Size(532, 207);

this->ControlBox = false;

this->Controls->Add(this->label3);

this->Controls->Add(this->label2);

this->Controls->Add(this->label1);

this->Controls->Add(this->textBox3);

this->Controls->Add(this->textBox2);

this->Controls->Add(this->button1);

this->Controls->Add(this->textBox1);

this->MaximizeBox = false;

this->MaximumSize = System::Drawing::Size(548, 245);

this->MinimizeBox = false;

this->MinimumSize = System::Drawing::Size(548, 245);

this->Name = L"Start";

this->Text = L"Введите название курсового листа";

this->Load += gcnew System::EventHandler(this, &Start::Start_Load);

this->ResumeLayout(false);

this->PerformLayout();

}

#pragma endregion

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

Int32 flag=0;

if(textBox1->Text!=""){

flag++;

}

else{

MessageBox::Show("Введитеназваниекурсовоголиста!","Ошибка!",MessageBoxButtons::OK,MessageBoxIcon::Error);

}

if(textBox2->Text!=""){

flag++;

}

else{

MessageBox::Show("Введитесоставприемнойкомиссии!","Ошибка!",MessageBoxButtons::OK,MessageBoxIcon::Error);

}

if(textBox3->Text!=""){

flag++;

}

else{

MessageBox::Show("Введитедатуутверждениякурсовоголиста!","Ошибка!",MessageBoxButtons::OK,MessageBoxIcon::Error);

}

if(flag==3){

this->DialogResult=System::Windows::Forms::DialogResult::OK;

this->Close();

}

}

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

}

};

}

Файл Search.h. Окнопоиска.

#pragma once

namespace WindowsFormApplicationC {

using namespace System;

using namespace System::ComponentModel;

using namespace System::Collections;

using namespace System::Windows::Forms;

using namespace System::Data;

using namespace System::Drawing;

public ref class Search : public System::Windows::Forms::Form

{

public:

Search(void)

{

InitializeComponent();

}

protected:

~Search()

{

if (components)

{

delete components;

}

}

private: System::Windows::Forms::Button^ button1;

protected:

private: System::Windows::Forms::Button^ button2;

public: System::Windows::Forms::TextBox^ textBox1;

public:

private:

System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code

void InitializeComponent(void)

{

this->button1 = (gcnew System::Windows::Forms::Button());

this->button2 = (gcnew System::Windows::Forms::Button());

this->textBox1 = (gcnew System::Windows::Forms::TextBox());

this->SuspendLayout();

//

// button1

//

this->button1->Location = System::Drawing::Point(12, 147);

this->button1->Name = L"button1";

this->button1->Size = System::Drawing::Size(75, 23);

this->button1->TabIndex = 0;

this->button1->Text = L"Поиск";

this->button1->UseVisualStyleBackColor = true;

this->button1->Click += gcnew System::EventHandler(this, &Search::button1_Click);

//

// button2

//

this->button2->Location = System::Drawing::Point(297, 147);

this->button2->Name = L"button2";

this->button2->Size = System::Drawing::Size(75, 23);

this->button2->TabIndex = 1;

this->button2->Text = L"Отмена";

this->button2->UseVisualStyleBackColor = true;

this->button2->Click += gcnew System::EventHandler(this, &Search::button2_Click);

//

// textBox1

//

this->textBox1->Location = System::Drawing::Point(12, 61);

this->textBox1->Name = L"textBox1";

this->textBox1->Size = System::Drawing::Size(360, 20);

this->textBox1->TabIndex = 2;

//

// Search

//

this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);

this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;

this->ClientSize = System::Drawing::Size(384, 182);

this->ControlBox = false;

this->Controls->Add(this->textBox1);

this->Controls->Add(this->button2);

this->Controls->Add(this->button1);

this->MaximumSize = System::Drawing::Size(400, 220);

this->MinimumSize = System::Drawing::Size(400, 220);

this->Name = L"Search";

this->Text = L"Поиск";

this->ResumeLayout(false);

this->PerformLayout();

}

#pragma endregion

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

this->Close();

}

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

if(textBox1->Text!=""){

this->DialogResult=System::Windows::Forms::DialogResult::OK;

this->Close();

}

else{

MessageBox::Show("Введитеинформациюдляпоиска!","Ошибка!",MessageBoxButtons::OK,MessageBoxIcon::Error);

}

}

};

}

Файл WindowsFormApplicationC++.cpp

#include "stdafx.h"

#include "Form1.h"

using namespace WindowsFormApplicationC;

[STAThreadAttribute]

int main(array<System::String ^> ^args)

{

// Enabling Windows XP visual effects before any controls are created

Application::EnableVisualStyles();

Application::SetCompatibleTextRenderingDefault(false);

// Create the main window and run it

Application::Run(gcnew Form1());

return 0;

}