AddO1f

LabF1

Apr 3rd, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.66 KB | None | 0 0
  1. #include "Form2.h"
  2.  
  3. #pragma endregion
  4. private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
  5.              Form2^ f = gcnew Form2 ();
  6.              this->Hide();
  7.              f->ShowDialog();
  8.              this->Show();
  9.          }
  10. private: System::Void button3_Click(System::Object^  sender, System::EventArgs^  e) {this->Hide();
  11.          };
  12. private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {if (textBox1->Text!=""){
  13.        this ->listBox1->Items->Clear();
  14.        this->listBox1->Font = (gcnew System::Drawing::Font(L"Arial", 14, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,  static_cast<System::Byte>(204)));
  15.        this->listBox1->ForeColor = System::Drawing::Color::Black;
  16.        this ->listBox1->Items->Add(this ->textBox1->Text);
  17.        if (radioButton1->Checked == true){ this->listBox1->ForeColor = System::Drawing::Color::Red;}      
  18.        if (radioButton2->Checked == true){ this->listBox1->ForeColor = System::Drawing::Color::Blue;}      
  19.        if (radioButton3->Checked == true){ this->listBox1->ForeColor = System::Drawing::Color::Green;}      
  20.        if (radioButton4->Checked == true){ this->listBox1->ForeColor = System::Drawing::Color::Yellow;}  
  21.        if (radioButton5->Checked == true){ this->listBox1->ForeColor = System::Drawing::Color::Black;}  
  22.        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)));}
  23.        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)));}  
  24.        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)));}
  25.        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)));}
  26.        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)));}
  27.        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)));
  28.        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)));
  29.        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)));
  30.        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)));
  31.        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)));
  32.        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)));
  33.        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)));
  34.        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)));}
  35.         else {MessageBox::Show( "Заполните пожалуйста данные", "Ошибка ввода данных ", MessageBoxButtons::OK, MessageBoxIcon::Exclamation );}
  36.         }
  37. };
  38. }
  39.  
  40. //Form2.h
  41. #pragma endregion
  42.     private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {this->Hide();};
  43.     };
  44. }
Advertisement
Add Comment
Please, Sign In to add comment