Está en la página 1de 8

#pragma once

namespace fr1 { using using using using using using namespace namespace namespace namespace namespace namespace System; System::ComponentModel; System::Collections; System::Windows::Forms; System::Data; System::Drawing;

/// <summary> /// Summary for Form1 /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// </summary> public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::PictureBox^ pictureBox1; protected: private: System::Windows::Forms::PictureBox^ pictureBox2; private: System::Windows::Forms::PictureBox^ pictureBox3; private: System::Windows::Forms::PictureBox^ pictureBox4; private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::Button^ button3; private: System::Windows::Forms::Button^ button4; private: System::Windows::Forms::Timer^ timer1; private: System::ComponentModel::IContainer^ components;

private: /// <summary> /// Required designer variable. /// </summary>

#pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { this->components = (gcnew System::ComponentModel::Container()); this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox()); this->pictureBox2 = (gcnew System::Windows::Forms::PictureBox()); this->pictureBox3 = (gcnew System::Windows::Forms::PictureBox()); this->pictureBox4 = (gcnew System::Windows::Forms::PictureBox()); this->button1 = (gcnew System::Windows::Forms::Button()); this->button2 = (gcnew System::Windows::Forms::Button()); this->button3 = (gcnew System::Windows::Forms::Button()); this->button4 = (gcnew System::Windows::Forms::Button()); this->timer1 = (gcnew System::Windows::Forms::Timer(this->components)); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this>pictureBox1))->BeginInit(); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this>pictureBox2))->BeginInit(); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this>pictureBox3))->BeginInit(); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this>pictureBox4))->BeginInit(); this->SuspendLayout(); // // pictureBox1 // this->pictureBox1->Location = System::Drawing::Point(41, 134); this->pictureBox1->Name = L"pictureBox1"; this->pictureBox1->Size = System::Drawing::Size(84, 196); this->pictureBox1->TabIndex = 0; this->pictureBox1->TabStop = false; this->pictureBox1->Click += gcnew System::EventHandler(this, &Form1::pictureBox1_Click); // // pictureBox2 // this->pictureBox2->Location = System::Drawing::Point(249, 134); this->pictureBox2->Name = L"pictureBox2"; this->pictureBox2->Size = System::Drawing::Size(160, 155); this->pictureBox2->TabIndex = 1; this->pictureBox2->TabStop = false; this->pictureBox2->Click += gcnew System::EventHandler(this, &Form1::pictureBox2_Click); // // pictureBox3 //

this->pictureBox3->Location = System::Drawing::Point(204, 374); this->pictureBox3->Name = L"pictureBox3"; this->pictureBox3->Size = System::Drawing::Size(248, 228); this->pictureBox3->TabIndex = 2; this->pictureBox3->TabStop = false; this->pictureBox3->Click += gcnew System::EventHandler(this, &Form1::pictureBox3_Click); // // pictureBox4 // this->pictureBox4->Location = System::Drawing::Point(516, 134); this->pictureBox4->Name = L"pictureBox4"; this->pictureBox4->Size = System::Drawing::Size(430, 519); this->pictureBox4->TabIndex = 3; this->pictureBox4->TabStop = false; this->pictureBox4->Click += gcnew System::EventHandler(this, &Form1::pictureBox4_Click); // // button1 // this->button1->Location = System::Drawing::Point(39, 371); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(85, 42); this->button1->TabIndex = 4; this->button1->Text = L"button1"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click); // // button2 // this->button2->Location = System::Drawing::Point(39, 433); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(84, 33); this->button2->TabIndex = 5; this->button2->Text = L"button2"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click); // // button3 // this->button3->Location = System::Drawing::Point(40, 503); this->button3->Name = L"button3"; this->button3->Size = System::Drawing::Size(82, 36); this->button3->TabIndex = 6; this->button3->Text = L"button3"; this->button3->UseVisualStyleBackColor = true; this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click); // // button4 // this->button4->Location = System::Drawing::Point(40, 567); this->button4->Name = L"button4";

this->button4->Size = System::Drawing::Size(82, 34); this->button4->TabIndex = 7; this->button4->Text = L"button4"; this->button4->UseVisualStyleBackColor = true; this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click); // // timer1 // this->timer1->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick); // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(970, 666); this->Controls->Add(this->button4); this->Controls->Add(this->button3); this->Controls->Add(this->button2); this->Controls->Add(this->button1); this->Controls->Add(this->pictureBox4); this->Controls->Add(this->pictureBox3); this->Controls->Add(this->pictureBox2); this->Controls->Add(this->pictureBox1); this->Name = L"Form1"; this->Text = L"Form1"; (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this>pictureBox1))->EndInit(); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this>pictureBox2))->EndInit(); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this>pictureBox3))->EndInit(); (cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this>pictureBox4))->EndInit(); this->ResumeLayout(false); } #pragma endregion private: System::Void pictureBox1_Click(System::Object^ { } private: System::Void pictureBox2_Click(System::Object^ { } private: System::Void pictureBox3_Click(System::Object^ { } private: System::Void pictureBox4_Click(System::Object^ { } private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { this->pictureBox1->Image=Image::FromFile("d1.jpg"); timer1.Start(); sender, System::EventArgs^ e) sender, System::EventArgs^ e)

sender, System::EventArgs^

e)

sender, System::EventArgs^

e)

} private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { this->pictureBox1->Image=Image::FromFile("d2.jpg"); } private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { this->pictureBox1->Image=Image::FromFile("d3.jpg"); } private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) { this->pictureBox1->Image=Image::FromFile("d4.jpg"); } private: System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e) { } }; }

On sensor 1 and 2 Off sensor 1 and 2

On sensor 3 and 4 Off sensor 1 and 2


Case1(button1==true) this->pictureBox4->Image=Image::FromFile("t2.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b2.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b3.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b4.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b5.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b6.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b7.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b8.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b9.jpg"); this->pictureBox4->Image=Image::FromFile("t3.jpg"); timer interval 2second this->pictureBox4->Image=Image::FromFile("t4.jpg"); case2(button2==true) this->pictureBox4->Image=Image::FromFile("t5.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a2.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a3.jpg");

timer interval 1second this->pictureBox3->Image=Image::FromFile("a4.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a5.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a6.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a7.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a8.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a9.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a10.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a11.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a12.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a13.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a14.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a15.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a16.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a17.jpg"); this->pictureBox4->Image=Image::FromFile("t6.jpg"); timer interval 2second this->pictureBox4->Image=Image::FromFile("t7.jpg");

case(button3==true) this->pictureBox4->Image=Image::FromFile("t2.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b2.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b3.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b4.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b5.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b6.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b7.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b8.jpg"); timer interval 1second this->pictureBox2->Image=Image::FromFile("b9.jpg"); this->pictureBox4->Image=Image::FromFile("t3.jpg"); timer interval 2second this->pictureBox4->Image=Image::FromFile("t4.jpg");

case(button4==true) this->pictureBox4->Image=Image::FromFile("t5.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a2.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a3.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a4.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a5.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a6.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a7.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a8.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a9.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a10.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a11.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a12.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a13.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a14.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a15.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a16.jpg"); timer interval 1second this->pictureBox3->Image=Image::FromFile("a17.jpg"); this->pictureBox4->Image=Image::FromFile("t6.jpg"); timer interval 2second this->pictureBox4->Image=Image::FromFile("t7.jpg");

Default if button1 or button 2 is not detected image t2 (12s) image t3 (2s) image t4
switch(button) { case 1: cout << break; case 2: cout << break; case 3: cout << break; case 4: cout << break;

endl << "Boil some eggs." << endl; endl << "Fry some eggs." << endl; endl << "Scramble some eggs." << endl; endl << "Coddle some eggs." << endl;

default: cout << endl << "You entered a wrong number, try raw eggs." << endl; }

También podría gustarte