Facebook
From Queen Anoa, 3 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 118
  1. #pragma once
  2. #include <cstdlib>
  3.  
  4. namespace Project24 {
  5.  
  6.         using namespace System;
  7.         using namespace System::ComponentModel;
  8.         using namespace System::Collections;
  9.         using namespace System::Windows::Forms;
  10.         using namespace System::Data;
  11.         using namespace System::Drawing;
  12.  
  13.         /// <summary>
  14.         /// Summary for okno1
  15.         /// </summary>
  16.         public ref class okno1 : public System::Windows::Forms::Form
  17.         {
  18.         public:
  19.                 okno1(void)
  20.                 {
  21.                         InitializeComponent();
  22.                         //
  23.                         //TODO: Add the constructor code here
  24.                         //
  25.                 }
  26.  
  27.         protected:
  28.                 /// <summary>
  29.                 /// Clean up any resources being used.
  30.                 /// </summary>
  31.                 ~okno1()
  32.                 {
  33.                         if (components)
  34.                         {
  35.                                 delete components;
  36.                         }
  37.                 }
  38.         public: System::Windows::Forms::Label^  label1;
  39.         private: System::Windows::Forms::Button^  button1;
  40.         private: System::Windows::Forms::Button^  button2;
  41.         protected:
  42.  
  43.         private:
  44.                 /// <summary>
  45.                 /// Required designer variable.
  46.                 /// </summary>
  47.                 System::ComponentModel::Container ^components;
  48.  
  49. #pragma region Windows Form Designer generated code
  50.                 /// <summary>
  51.                 /// Required method for Designer support - do not modify
  52.                 /// the contents of this method with the code editor.
  53.                 /// </summary>
  54.                 void InitializeComponent(void)
  55.                 {
  56.                         this->label1 = (gcnew System::Windows::Forms::Label());
  57.                         this->button1 = (gcnew System::Windows::Forms::Button());
  58.                         this->button2 = (gcnew System::Windows::Forms::Button());
  59.                         this->SuspendLayout();
  60.                         //
  61.                         // label1
  62.                         //
  63.                         this->label1->AutoSize = true;
  64.                         this->label1->Location = System::Drawing::Point(75, 60);
  65.                         this->label1->Name = L"label1";
  66.                         this->label1->Size = System::Drawing::Size(35, 13);
  67.                         this->label1->TabIndex = 0;
  68.                         this->label1->Text = L"label1";
  69.                         //
  70.                         // button1
  71.                         //
  72.                         this->button1->Location = System::Drawing::Point(127, 155);
  73.                         this->button1->Name = L"button1";
  74.                         this->button1->Size = System::Drawing::Size(75, 23);
  75.                         this->button1->TabIndex = 1;
  76.                         this->button1->Text = L"button1";
  77.                         this->button1->UseVisualStyleBackColor = true;
  78.                         this->button1->Click += gcnew System::EventHandler(this, &okno1::button1_Click);
  79.                         //
  80.                         // button2
  81.                         //
  82.                         this->button2->Location = System::Drawing::Point(53, 122);
  83.                         this->button2->Name = L"button2";
  84.                         this->button2->Size = System::Drawing::Size(75, 27);
  85.                         this->button2->TabIndex = 2;
  86.                         this->button2->Text = L"button2";
  87.                         this->button2->UseVisualStyleBackColor = true;
  88.                         this->button2->Click += gcnew System::EventHandler(this, &okno1::button2_Click);
  89.                         //
  90.                         // okno1
  91.                         //
  92.                         this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  93.                         this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  94.                         this->ClientSize = System::Drawing::Size(284, 262);
  95.                         this->Controls->Add(this->button2);
  96.                         this->Controls->Add(this->button1);
  97.                         this->Controls->Add(this->label1);
  98.                         this->Name = L"okno1";
  99.                         this->Text = L"okno1";
  100.                         this->ResumeLayout(false);
  101.                         this->PerformLayout();
  102.  
  103.                 }
  104.         public: int x;
  105.                
  106. #pragma endregion
  107.         private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
  108.                
  109.                 x++;
  110.                 label1->Text = x.ToString();
  111.         }
  112.         private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
  113.                 x--;
  114.                
  115.                 label1->Text=x.ToString();
  116.         }
  117.         };
  118. }
  119.