![]() |
|
|
Курсовая работа: Структура иерархии классов "Экран курсового проектирования"System::Windows::Forms::DialogResult dialres; Form2 ^newdlg=gcnew Form2(); newdlg->textBox1->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[0]->Value); newdlg->textBox2->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[1]->Value); newdlg->textBox3->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[2]->Value); newdlg->textBox4->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[3]->Value); newdlg->textBox5->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[4]->Value); newdlg->textBox6->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[5]->Value); newdlg->textBox7->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[6]->Value); newdlg->textBox8->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[7]->Value); newdlg->textBox9->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[8]->Value); newdlg->textBox10->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[9]->Value); newdlg->textBox11->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[10]->Value); newdlg->textBox12->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[11]->Value); newdlg->textBox13->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[12]->Value); newdlg->textBox14->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[13]->Value); newdlg->textBox15->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[14]->Value); newdlg->textBox16->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[15]->Value); newdlg->textBox17->Text=System::Convert::ToString(this->dataGridView1->SelectedRows[0]->Cells[16]->Value); dialres=newdlg->ShowDialog(); if(dialres==System::Windows::Forms::DialogResult::OK){ this->dataGridView1->SelectedRows[0]->Cells[0]->Value=newdlg->textBox1->Text; this->dataGridView1->SelectedRows[0]->Cells[1]->Value=newdlg->textBox2->Text; this->dataGridView1->SelectedRows[0]->Cells[2]->Value=newdlg->textBox3->Text; this->dataGridView1->SelectedRows[0]->Cells[3]->Value=newdlg->textBox4->Text; this->dataGridView1->SelectedRows[0]->Cells[4]->Value=newdlg->textBox5->Text; this->dataGridView1->SelectedRows[0]->Cells[5]->Value=newdlg->textBox6->Text; this->dataGridView1->SelectedRows[0]->Cells[6]->Value=newdlg->textBox7->Text; this->dataGridView1->SelectedRows[0]->Cells[7]->Value=newdlg->textBox8->Text; this->dataGridView1->SelectedRows[0]->Cells[8]->Value=newdlg->textBox9->Text; this->dataGridView1->SelectedRows[0]->Cells[9]->Value=newdlg->textBox10->Text; this->dataGridView1->SelectedRows[0]->Cells[10]->Value=newdlg->textBox11->Text; this->dataGridView1->SelectedRows[0]->Cells[11]->Value=newdlg->textBox12->Text; this->dataGridView1->SelectedRows[0]->Cells[12]->Value=newdlg->textBox13->Text; this->dataGridView1->SelectedRows[0]->Cells[13]->Value=newdlg->textBox14->Text; this->dataGridView1->SelectedRows[0]->Cells[14]->Value=newdlg->textBox15->Text; this->dataGridView1->SelectedRows[0]->Cells[15]->Value=newdlg->textBox16->Text; this->dataGridView1->SelectedRows[0]->Cells[16]->Value=newdlg->textBox17->Text; } MessageBox::Show("Записьотредактирована!","Information",MessageBoxButtons::OK,MessageBoxIcon::Information); } else{ MessageBox::Show("Невыделенаредактируемаястрока!","Ошибка",MessageBoxButtons::OK,MessageBoxIcon::Error); } } } private: System::Void aboutToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) { MessageBox::Show("\"\Экранкурсовогопроектирования\"\ Версия 1.0","Опрограмме",MessageBoxButtons::OK,MessageBoxIcon::Information); } private: System::Void checkBox1_CheckedChanged(System::Object^ sender, System::EventArgs^ e) { if(checkBox1->Checked==true&&CountDataGrid!=0){ button2->Enabled=true; button6->Enabled=true; dataGridView1->RowHeadersVisible=true; } if(checkBox1->Checked==false&&CountDataGrid!=0){ dataGridView1->RowHeadersVisible=false; button2->Enabled=false; button6->Enabled=false; } } }; } ФайлForm2.h. Окнодобавления/редактированиязаписей. #pragma once #include "TStudent.h" 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; using namespace System::IO; public ref class Form2 : public System::Windows::Forms::Form { public: Form2(void) { InitializeComponent(); } protected: ~Form2() { if (components) { delete components; } } public: System::Windows::Forms::TextBox^ textBox1; protected: public: System::Windows::Forms::TextBox^ textBox2; public: System::Windows::Forms::TextBox^ textBox3; public: System::Windows::Forms::TextBox^ textBox4; public: System::Windows::Forms::TextBox^ textBox5; public: System::Windows::Forms::TextBox^ textBox6; public: System::Windows::Forms::TextBox^ textBox7; public: System::Windows::Forms::TextBox^ textBox8; public: System::Windows::Forms::TextBox^ textBox9; public: System::Windows::Forms::TextBox^ textBox10; public: System::Windows::Forms::TextBox^ textBox11; public: System::Windows::Forms::TextBox^ textBox12; public: System::Windows::Forms::TextBox^ textBox13; public: System::Windows::Forms::TextBox^ textBox14; public: System::Windows::Forms::TextBox^ textBox15; public: System::Windows::Forms::TextBox^ textBox16; private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::Button^ button3; public: System::Windows::Forms::TextBox^ textBox17; private: System::Windows::Forms::Label^ label1; private: System::Windows::Forms::Label^ label2; private: System::Windows::Forms::Label^ label3; private: System::Windows::Forms::Label^ label4; private: System::Windows::Forms::Label^ label5; private: System::Windows::Forms::Label^ label6; private: System::Windows::Forms::Label^ label7; private: System::Windows::Forms::Label^ label8; private: System::Windows::Forms::Label^ label9; private: System::Windows::Forms::Label^ label10; private: System::Windows::Forms::Label^ label11; private: System::Windows::Forms::Label^ label12; private: System::Windows::Forms::Label^ label13; private: System::Windows::Forms::Label^ label14; private: System::Windows::Forms::Label^ label15; private: System::Windows::Forms::Label^ label16; private: System::Windows::Forms::Label^ label17; private: System::Windows::Forms::Label^ label18; private: System::Windows::Forms::Label^ label19; private: System::Windows::Forms::Label^ label20; private: System::Windows::Forms::Button^ button4; private: System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code void InitializeComponent(void) { this->textBox1 = (gcnew System::Windows::Forms::TextBox()); this->textBox2 = (gcnew System::Windows::Forms::TextBox()); this->textBox3 = (gcnew System::Windows::Forms::TextBox()); this->textBox4 = (gcnew System::Windows::Forms::TextBox()); this->textBox5 = (gcnew System::Windows::Forms::TextBox()); this->textBox6 = (gcnew System::Windows::Forms::TextBox()); this->textBox7 = (gcnew System::Windows::Forms::TextBox()); this->textBox8 = (gcnew System::Windows::Forms::TextBox()); this->textBox9 = (gcnew System::Windows::Forms::TextBox()); this->textBox10 = (gcnew System::Windows::Forms::TextBox()); this->textBox11 = (gcnew System::Windows::Forms::TextBox()); this->textBox12 = (gcnew System::Windows::Forms::TextBox()); this->textBox13 = (gcnew System::Windows::Forms::TextBox()); this->textBox14 = (gcnew System::Windows::Forms::TextBox()); this->textBox15 = (gcnew System::Windows::Forms::TextBox()); this->textBox16 = (gcnew System::Windows::Forms::TextBox()); this->button1 = (gcnew System::Windows::Forms::Button()); this->button2 = (gcnew System::Windows::Forms::Button()); this->button3 = (gcnew System::Windows::Forms::Button()); this->textBox17 = (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->label4 = (gcnew System::Windows::Forms::Label()); this->label5 = (gcnew System::Windows::Forms::Label()); this->label6 = (gcnew System::Windows::Forms::Label()); this->label7 = (gcnew System::Windows::Forms::Label()); this->label8 = (gcnew System::Windows::Forms::Label()); this->label9 = (gcnew System::Windows::Forms::Label()); this->label10 = (gcnew System::Windows::Forms::Label()); this->label11 = (gcnew System::Windows::Forms::Label()); this->label12 = (gcnew System::Windows::Forms::Label()); this->label13 = (gcnew System::Windows::Forms::Label()); this->label14 = (gcnew System::Windows::Forms::Label()); this->label15 = (gcnew System::Windows::Forms::Label()); this->label16 = (gcnew System::Windows::Forms::Label()); this->label17 = (gcnew System::Windows::Forms::Label()); this->label18 = (gcnew System::Windows::Forms::Label()); this->label19 = (gcnew System::Windows::Forms::Label()); this->label20 = (gcnew System::Windows::Forms::Label()); this->button4 = (gcnew System::Windows::Forms::Button()); this->SuspendLayout(); // // textBox1 // this->textBox1->AccessibleDescription = L""; this->textBox1->Location = System::Drawing::Point(12, 38); this->textBox1->Name = L"textBox1"; this->textBox1->Size = System::Drawing::Size(290, 20); this->textBox1->TabIndex = 0; // // textBox2 // this->textBox2->Location = System::Drawing::Point(12, 90); this->textBox2->MaxLength = 3; this->textBox2->Name = L"textBox2"; this->textBox2->Size = System::Drawing::Size(47, 20); this->textBox2->TabIndex = 1; // // textBox3 // this->textBox3->Location = System::Drawing::Point(12, 142); this->textBox3->MaxLength = 3; this->textBox3->Name = L"textBox3"; this->textBox3->Size = System::Drawing::Size(47, 20); this->textBox3->TabIndex = 2; // // textBox4 // this->textBox4->Location = System::Drawing::Point(12, 194); this->textBox4->MaxLength = 3; this->textBox4->Name = L"textBox4"; this->textBox4->Size = System::Drawing::Size(47, 20); this->textBox4->TabIndex = 3; // // textBox5 // this->textBox5->Location = System::Drawing::Point(142, 90); this->textBox5->MaxLength = 3; this->textBox5->Name = L"textBox5"; this->textBox5->Size = System::Drawing::Size(47, 20); this->textBox5->TabIndex = 4; // // textBox6 // this->textBox6->Location = System::Drawing::Point(142, 139); this->textBox6->MaxLength = 3; this->textBox6->Name = L"textBox6"; this->textBox6->Size = System::Drawing::Size(47, 20); this->textBox6->TabIndex = 5; // // textBox7 // this->textBox7->Location = System::Drawing::Point(142, 194); this->textBox7->MaxLength = 3; this->textBox7->Name = L"textBox7"; this->textBox7->Size = System::Drawing::Size(47, 20); this->textBox7->TabIndex = 6; // // textBox8 // this->textBox8->Location = System::Drawing::Point(271, 90); this->textBox8->MaxLength = 3; this->textBox8->Name = L"textBox8"; this->textBox8->Size = System::Drawing::Size(47, 20); this->textBox8->TabIndex = 7; // // textBox9 // this->textBox9->Location = System::Drawing::Point(271, 142); this->textBox9->MaxLength = 3; this->textBox9->Name = L"textBox9"; this->textBox9->Size = System::Drawing::Size(47, 20); this->textBox9->TabIndex = 8; // // textBox10 // this->textBox10->Location = System::Drawing::Point(271, 194); this->textBox10->MaxLength = 3; this->textBox10->Name = L"textBox10"; this->textBox10->Size = System::Drawing::Size(47, 20); this->textBox10->TabIndex = 9; // // textBox11 // this->textBox11->Location = System::Drawing::Point(418, 106); this->textBox11->MaxLength = 10; this->textBox11->Name = L"textBox11"; this->textBox11->Size = System::Drawing::Size(129, 20); this->textBox11->TabIndex = 10; // // textBox12 // this->textBox12->Location = System::Drawing::Point(587, 106); this->textBox12->MaxLength = 10; this->textBox12->Name = L"textBox12"; this->textBox12->Size = System::Drawing::Size(129, 20); this->textBox12->TabIndex = 11; // // textBox13 // this->textBox13->Location = System::Drawing::Point(418, 177); this->textBox13->MaxLength = 10; this->textBox13->Name = L"textBox13"; this->textBox13->Size = System::Drawing::Size(129, 20); this->textBox13->TabIndex = 12; // // textBox14 // this->textBox14->Location = System::Drawing::Point(587, 177); this->textBox14->MaxLength = 10; this->textBox14->Name = L"textBox14"; this->textBox14->Size = System::Drawing::Size(129, 20); this->textBox14->TabIndex = 13; // // textBox15 // this->textBox15->Location = System::Drawing::Point(12, 297); this->textBox15->MaxLength = 10; this->textBox15->Name = L"textBox15"; this->textBox15->Size = System::Drawing::Size(129, 20); this->textBox15->TabIndex = 14; // // textBox16 // this->textBox16->Location = System::Drawing::Point(173, 297); this->textBox16->MaxLength = 10; this->textBox16->Name = L"textBox16"; this->textBox16->Size = System::Drawing::Size(129, 20); this->textBox16->TabIndex = 15; // // button1 // this->button1->Location = System::Drawing::Point(744, 281); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(126, 60); this->button1->TabIndex = 16; this->button1->Text = L"Добавить"; this->button1->UseVisualStyleBackColor = true; this->button1->Visible = false; this->button1->Click += gcnew System::EventHandler(this, &Form2::button1_Click); // // button2 // this->button2->Location = System::Drawing::Point(795, 113); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(75, 23); this->button2->TabIndex = 17; this->button2->Text = L"Отмена"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form2::button2_Click); // // button3 // this->button3->Location = System::Drawing::Point(795, 61); this->button3->Name = L"button3"; this->button3->Size = System::Drawing::Size(75, 23); this->button3->TabIndex = 18; this->button3->Text = L"Очистить"; this->button3->UseVisualStyleBackColor = true; this->button3->Click += gcnew System::EventHandler(this, &Form2::button3_Click); // // textBox17 // this->textBox17->Location = System::Drawing::Point(547, 297); this->textBox17->MaxLength = 3; this->textBox17->Name = L"textBox17"; this->textBox17->Size = System::Drawing::Size(52, 20); this->textBox17->TabIndex = 19; // // label1 // this->label1->AutoSize = true; this->label1->Location = System::Drawing::Point(13, 12); this->label1->Name = L"label1"; this->label1->Size = System::Drawing::Size(82, 13); this->label1->TabIndex = 20; this->label1->Text = L"ФИОстудента"; // // label2 // this->label2->AutoSize = true; this->label2->Location = System::Drawing::Point(13, 71); this->label2->Name = L"label2"; this->label2->Size = System::Drawing::Size(107, 13); this->label2->TabIndex = 21; this->label2->Text = L"1 к.н. задан. % вып."; // // label3 // this->label3->AutoSize = true; this->label3->Location = System::Drawing::Point(13, 123); this->label3->Name = L"label3"; this->label3->Size = System::Drawing::Size(102, 13); this->label3->TabIndex = 22; this->label3->Text = L"1 к.н. факт. % вып."; // // label4 // this->label4->AutoSize = true; this->label4->Location = System::Drawing::Point(13, 175); this->label4->Name = L"label4"; this->label4->Size = System::Drawing::Size(111, 13); this->label4->TabIndex = 23; this->label4->Text = L"контрольнаяоценка"; // // label5 // this->label5->AutoSize = true; this->label5->Location = System::Drawing::Point(139, 71); this->label5->Name = L"label5"; this->label5->Size = System::Drawing::Size(107, 13); this->label5->TabIndex = 24; this->label5->Text = L"2 к.н. задан. % вып."; // // label6 // this->label6->AutoSize = true; this->label6->Location = System::Drawing::Point(139, 123); this->label6->Name = L"label6"; this->label6->Size = System::Drawing::Size(102, 13); this->label6->TabIndex = 25; this->label6->Text = L"2 к.н. факт. % вып."; // // label7 // this->label7->AutoSize = true; this->label7->Location = System::Drawing::Point(139, 175); this->label7->Name = L"label7"; this->label7->Size = System::Drawing::Size(111, 13); this->label7->TabIndex = 26; this->label7->Text = L"контрольнаяоценка"; // // label8 // this->label8->AutoSize = true; this->label8->Location = System::Drawing::Point(268, 71); this->label8->Name = L"label8"; this->label8->Size = System::Drawing::Size(107, 13); this->label8->TabIndex = 27; this->label8->Text = L"3 к.н. задан. % вып."; // // label9 // this->label9->AutoSize = true; this->label9->Location = System::Drawing::Point(268, 123); this->label9->Name = L"label9"; this->label9->Size = System::Drawing::Size(102, 13); this->label9->TabIndex = 28; this->label9->Text = L"3 к.н. факт. % вып."; // // label10 // this->label10->AutoSize = true; this->label10->Location = System::Drawing::Point(268, 175); this->label10->Name = L"label10"; this->label10->Size = System::Drawing::Size(111, 13); this->label10->TabIndex = 29; this->label10->Text = L"контрольнаяоценка"; // // label11 // this->label11->AutoSize = true; this->label11->Location = System::Drawing::Point(415, 71); this->label11->Name = L"label11"; this->label11->Size = System::Drawing::Size(264, 13); this->label11->TabIndex = 30; this->label11->Text = L"Дата сдачи заверш. проекта (работы) на проверку"; // // label12 // this->label12->AutoSize = true; this->label12->Location = System::Drawing::Point(461, 90); this->label12->Name = L"label12"; this->label12->Size = System::Drawing::Size(33, 13); this->label12->TabIndex = 31; this->label12->Text = L"План"; // // label13 // this->label13->AutoSize = true; this->label13->Location = System::Drawing::Point(632, 90); this->label13->Name = L"label13"; this->label13->Size = System::Drawing::Size(38, 13); this->label13->TabIndex = 32; this->label13->Text = L"Факт."; // // label14 // this->label14->AutoSize = true; this->label14->Location = System::Drawing::Point(415, 139); this->label14->Name = L"label14"; this->label14->Size = System::Drawing::Size(275, 13); this->label14->TabIndex = 33; this->label14->Text = L"Дата выдачи проекта (работы) препод. на доработку"; // // label15 // this->label15->AutoSize = true; this->label15->Location = System::Drawing::Point(461, 161); this->label15->Name = L"label15"; this->label15->Size = System::Drawing::Size(33, 13); this->label15->TabIndex = 34; this->label15->Text = L"План"; // // label16 // this->label16->AutoSize = true; this->label16->Location = System::Drawing::Point(632, 161); this->label16->Name = L"label16"; this->label16->Size = System::Drawing::Size(38, 13); this->label16->TabIndex = 35; this->label16->Text = L"Факт."; // // label17 // this->label17->AutoSize = true; this->label17->Location = System::Drawing::Point(114, 261); this->label17->Name = L"label17"; this->label17->Size = System::Drawing::Size(76, 13); this->label17->TabIndex = 36; this->label17->Text = L"Датазащиты"; // // label18 // this->label18->AutoSize = true; this->label18->Location = System::Drawing::Point(50, 281); this->label18->Name = L"label18"; this->label18->Size = System::Drawing::Size(33, 13); this->label18->TabIndex = 37; this->label18->Text = L"План"; // // label19 // this->label19->AutoSize = true; this->label19->Location = System::Drawing::Point(212, 281); this->label19->Name = L"label19"; this->label19->Size = System::Drawing::Size(38, 13); this->label19->TabIndex = 38; this->label19->Text = L"Факт."; // // label20 // this->label20->AutoSize = true; this->label20->BackColor = System::Drawing::SystemColors::Control; this->label20->CausesValidation = false; this->label20->Location = System::Drawing::Point(527, 261); this->label20->Name = L"label20"; this->label20->Size = System::Drawing::Size(97, 13); this->label20->TabIndex = 39; this->label20->Text = L"Оценказаработу"; // // button4 // this->button4->Location = System::Drawing::Point(744, 194); this->button4->Name = L"button4"; this->button4->Size = System::Drawing::Size(126, 60); this->button4->TabIndex = 40; this->button4->Text = L"Проверка"; this->button4->UseVisualStyleBackColor = true; this->button4->Click += gcnew System::EventHandler(this, &Form2::button4_Click); // // Form2 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(882, 353); this->Controls->Add(this->button4); 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; } |
![]() |
||
НОВОСТИ | ![]() |
![]() |
||
ВХОД | ![]() |
|
Рефераты бесплатно, реферат бесплатно, курсовые работы, реферат, доклады, рефераты, рефераты скачать, рефераты на тему, сочинения, курсовые, дипломы, научные работы и многое другое. |
||
При использовании материалов - ссылка на сайт обязательна. |