Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. #pragma once
  2.  
  3. namespace Projekt1 {
  4.  
  5. using namespace System;
  6. using namespace System::ComponentModel;
  7. using namespace System::Collections;
  8. using namespace System::Windows::Forms;
  9. using namespace System::Data;
  10. using namespace System::Drawing;
  11.  
  12. /// <summary>
  13. /// Podsumowanie informacji o MyForm
  14. /// </summary>
  15. public ref class MyForm : public System::Windows::Forms::Form
  16. {
  17. public:
  18. MyForm(void)
  19. {
  20. InitializeComponent();
  21. //
  22. //TODO: W tym miejscu dodaj kod konstruktora
  23. //
  24. }
  25.  
  26. protected:
  27. /// <summary>
  28. /// Wyczyść wszystkie używane zasoby.
  29. /// </summary>
  30. ~MyForm()
  31. {
  32. if (components)
  33. {
  34. delete components;
  35. }
  36. }
  37. private: System::Windows::Forms::PictureBox^ cover1;
  38. private: System::Windows::Forms::PictureBox^ pictureBox1;
  39. protected:
  40.  
  41. protected:
  42.  
  43. protected:
  44.  
  45. protected:
  46.  
  47. protected:
  48.  
  49. private:
  50. /// <summary>
  51. /// Wymagana zmienna projektanta.
  52. /// </summary>
  53. System::ComponentModel::Container ^components;
  54.  
  55. #pragma region Windows Form Designer generated code
  56. /// <summary>
  57. /// Metoda wymagana do obsługi projektanta — nie należy modyfikować
  58. /// jej zawartości w edytorze kodu.
  59. /// </summary>
  60. void InitializeComponent(void)
  61. {
  62. System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
  63. this->cover1 = (gcnew System::Windows::Forms::PictureBox());
  64. this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
  65. (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->cover1))->BeginInit();
  66. (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->BeginInit();
  67. this->SuspendLayout();
  68. //
  69. // cover1
  70. //
  71. this->cover1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"cover1.Image")));
  72. this->cover1->Location = System::Drawing::Point(33, 12);
  73. this->cover1->Name = L"cover1";
  74. this->cover1->Size = System::Drawing::Size(180, 105);
  75. this->cover1->TabIndex = 0;
  76. this->cover1->TabStop = false;
  77. this->cover1->Click += gcnew System::EventHandler(this, &MyForm::cover1_Click);
  78. //
  79. // pictureBox1
  80. //
  81. this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"pictureBox1.Image")));
  82. this->pictureBox1->Location = System::Drawing::Point(33, 12);
  83. this->pictureBox1->Name = L"pictureBox1";
  84. this->pictureBox1->Size = System::Drawing::Size(180, 105);
  85. this->pictureBox1->TabIndex = 1;
  86. this->pictureBox1->TabStop = false;
  87. this->pictureBox1->Click += gcnew System::EventHandler(this, &MyForm::pictureBox1_Click);
  88. //
  89. // MyForm
  90. //
  91. this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  92. this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  93. this->ClientSize = System::Drawing::Size(889, 579);
  94. this->Controls->Add(this->cover1);
  95. this->Controls->Add(this->pictureBox1);
  96. this->Name = L"MyForm";
  97. this->Text = L"Gra";
  98. (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->cover1))->EndInit();
  99. (cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->EndInit();
  100. this->ResumeLayout(false);
  101.  
  102. }
  103. #pragma endregion
  104.  
  105.  
  106. private: System::Void changeOnClick(System::Windows::Forms::PictureBox^ ukryta, System::Windows::Forms::PictureBox^ warstwa) {
  107. ukryta->Visible = true;
  108. warstwa->Visible = false;
  109.  
  110. }
  111.  
  112. private: System::Void cover1_Click(System::Object^ sender, System::EventArgs^ e) {
  113. if (cover1->Visible == true) {
  114. pictureBox1->Visible = true;
  115. cover1->Visible = false;
  116. }
  117. }
  118. private: System::Void pictureBox1_Click(System::Object^ sender, System::EventArgs^ e) {
  119. if (pictureBox1->Visible == true) {
  120. pictureBox1->Visible = false;
  121. cover1->Visible = true;
  122. }
  123. }
  124.  
  125. };
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement