Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Form2.h"
- #pragma endregion
- private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
- Form2^ f = gcnew Form2 ();
- this->Hide();
- f->ShowDialog();
- this->Show();
- }
- private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {this->Hide();
- };
- private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {if (textBox1->Text!=""){
- this ->listBox1->Items->Clear();
- this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));
- this->listBox1->ForeColor = System::Drawing::Color::Black;
- this ->listBox1->Items->Add(this ->textBox1->Text);
- if (radioButton1->Checked == true){ this->listBox1->ForeColor = System::Drawing::Color::Red;}
- if (radioButton2->Checked == true){ this->listBox1->ForeColor = System::Drawing::Color::Blue;}
- if (radioButton3->Checked == true){ this->listBox1->ForeColor = System::Drawing::Color::Green;}
- if (radioButton4->Checked == true){ this->listBox1->ForeColor = System::Drawing::Color::Yellow;}
- if (radioButton5->Checked == true){ this->listBox1->ForeColor = System::Drawing::Color::Black;}
- if (checkBox1->Checked == true){this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, System::Drawing::FontStyle:: Bold, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));}
- if (checkBox2->Checked == true){this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, System::Drawing::FontStyle:: Italic, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));}
- if (checkBox3->Checked == true){this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, System::Drawing::FontStyle:: Underline, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));}
- if (checkBox4->Checked == true){this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, System::Drawing::FontStyle:: Strikeout, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));}
- if ((checkBox1->Checked == true)&&(checkBox2->Checked == true)){this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Italic)), System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));}
- if ((checkBox1->Checked == true)&&(checkBox2->Checked == true)&&(checkBox3->Checked == true))this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, static_cast<System::Drawing::FontStyle>(((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Italic) | System::Drawing::FontStyle::Underline)), System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));
- if ((checkBox1->Checked == true)&&(checkBox2->Checked == true)&&(checkBox3->Checked == true)&&(checkBox4->Checked == true))this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, static_cast<System::Drawing::FontStyle>((((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Italic) | System::Drawing::FontStyle::Underline) | System::Drawing::FontStyle::Strikeout)), System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));
- if ((checkBox2->Checked == true)&&(checkBox3->Checked == true)&&(checkBox4->Checked == true))this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, static_cast<System::Drawing::FontStyle>(((System::Drawing::FontStyle::Italic | System::Drawing::FontStyle::Underline) | System::Drawing::FontStyle::Strikeout)), System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));
- if ((checkBox2->Checked == true)&&(checkBox3->Checked == true))this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Italic | System::Drawing::FontStyle::Underline)), System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));
- if ((checkBox2->Checked == true)&&(checkBox4->Checked == true))this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Italic | System::Drawing::FontStyle::Strikeout)), System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));
- if ((checkBox1->Checked == true)&&(checkBox3->Checked == true))this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Underline)), System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));
- if ((checkBox3->Checked == true)&&(checkBox4->Checked == true))this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Underline | System::Drawing::FontStyle::Strikeout)), System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));
- if ((checkBox1->Checked == true)&&(checkBox4->Checked == true))this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Strikeout)), System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(204)));}
- else {MessageBox::Show( "Заполните пожалуйста данные", "Ошибка ввода данных ", MessageBoxButtons::OK, MessageBoxIcon::Exclamation );}
- }
- };
- }
- //Form2.h
- #pragma endregion
- private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {this->Hide();};
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment