Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- namespace Projekt1 {
- 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>
- /// Podsumowanie informacji o MyForm
- /// </summary>
- public ref class MyForm : public System::Windows::Forms::Form
- {
- public:
- MyForm(void)
- {
- InitializeComponent();
- //
- //TODO: W tym miejscu dodaj kod konstruktora
- //
- }
- protected:
- /// <summary>
- /// Wyczyść wszystkie używane zasoby.
- /// </summary>
- ~MyForm()
- {
- if (components)
- {
- delete components;
- }
- }
- private: System::Windows::Forms::PictureBox^ cover1;
- private: System::Windows::Forms::PictureBox^ pictureBox1;
- protected:
- protected:
- protected:
- protected:
- protected:
- private:
- /// <summary>
- /// Wymagana zmienna projektanta.
- /// </summary>
- System::ComponentModel::Container ^components;
- #pragma region Windows Form Designer generated code
- /// <summary>
- /// Metoda wymagana do obsługi projektanta — nie należy modyfikować
- /// jej zawartości w edytorze kodu.
- /// </summary>
- void InitializeComponent(void)
- {
- System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
- this->cover1 = (gcnew System::Windows::Forms::PictureBox());
- this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
- (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->cover1))->BeginInit();
- (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->BeginInit();
- this->SuspendLayout();
- //
- // cover1
- //
- this->cover1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"cover1.Image")));
- this->cover1->Location = System::Drawing::Point(33, 12);
- this->cover1->Name = L"cover1";
- this->cover1->Size = System::Drawing::Size(180, 105);
- this->cover1->TabIndex = 0;
- this->cover1->TabStop = false;
- this->cover1->Click += gcnew System::EventHandler(this, &MyForm::cover1_Click);
- //
- // pictureBox1
- //
- this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"pictureBox1.Image")));
- this->pictureBox1->Location = System::Drawing::Point(33, 12);
- this->pictureBox1->Name = L"pictureBox1";
- this->pictureBox1->Size = System::Drawing::Size(180, 105);
- this->pictureBox1->TabIndex = 1;
- this->pictureBox1->TabStop = false;
- this->pictureBox1->Click += gcnew System::EventHandler(this, &MyForm::pictureBox1_Click);
- //
- // MyForm
- //
- this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
- this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
- this->ClientSize = System::Drawing::Size(889, 579);
- this->Controls->Add(this->cover1);
- this->Controls->Add(this->pictureBox1);
- this->Name = L"MyForm";
- this->Text = L"Gra";
- (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->cover1))->EndInit();
- (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->EndInit();
- this->ResumeLayout(false);
- }
- #pragma endregion
- private: System::Void changeOnClick(System::Windows::Forms::PictureBox^ ukryta, System::Windows::Forms::PictureBox^ warstwa) {
- ukryta->Visible = true;
- warstwa->Visible = false;
- }
- private: System::Void cover1_Click(System::Object^ sender, System::EventArgs^ e) {
- if (cover1->Visible == true) {
- pictureBox1->Visible = true;
- cover1->Visible = false;
- }
- }
- private: System::Void pictureBox1_Click(System::Object^ sender, System::EventArgs^ e) {
- if (pictureBox1->Visible == true) {
- pictureBox1->Visible = false;
- cover1->Visible = true;
- }
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement