Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 22nd, 2010 | Syntax: None | Size: 8.85 KB | Hits: 77 | Expires: Never
Copy text to clipboard
  1. #pragma once
  2.  
  3.  
  4. namespace My220310 {
  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 Form1
  15.         ///
  16.         /// WARNING: If you change the name of this class, you will need to change the
  17.         ///          'Resource File Name' property for the managed resource compiler tool
  18.         ///          associated with all .resx files this class depends on.  Otherwise,
  19.         ///          the designers will not be able to interact properly with localized
  20.         ///          resources associated with this form.
  21.         /// </summary>
  22.         public ref class Form1 : public System::Windows::Forms::Form
  23.         {
  24.         public:
  25.                 Form1(void)
  26.                 {
  27.                         InitializeComponent();
  28.                         //
  29.                         //TODO: Add the constructor code here
  30.                         //
  31.                 }
  32.  
  33.         protected:
  34.                 /// <summary>
  35.                 /// Clean up any resources being used.
  36.                 /// </summary>
  37.                 ~Form1()
  38.                 {
  39.                         if (components)
  40.                         {
  41.                                 delete components;
  42.                         }
  43.                 }
  44.         private: System::Windows::Forms::Button^  button1;
  45.         protected:
  46.         private: System::Windows::Forms::Label^  label1;
  47.         private: System::Windows::Forms::TextBox^  textBox1;
  48.         private: System::Windows::Forms::TextBox^  textBox2;
  49.         private: System::Windows::Forms::TextBox^  textBox3;
  50.         private: System::Windows::Forms::Label^  label2;
  51.         private: System::Windows::Forms::GroupBox^  groupBox1;
  52.         private: System::Windows::Forms::RadioButton^  radioButton4;
  53.         private: System::Windows::Forms::RadioButton^  radioButton3;
  54.         private: System::Windows::Forms::RadioButton^  radioButton2;
  55.         private: System::Windows::Forms::RadioButton^  radioButton1;
  56.  
  57.         private:
  58.                 /// <summary>
  59.                 /// Required designer variable.
  60.                 /// </summary>
  61.                 System::ComponentModel::Container ^components;
  62.  
  63. #pragma region Windows Form Designer generated code
  64.                 /// <summary>
  65.                 /// Required method for Designer support - do not modify
  66.                 /// the contents of this method with the code editor.
  67.                 /// </summary>
  68.                 void InitializeComponent(void)
  69.                 {
  70.                         this->button1 = (gcnew System::Windows::Forms::Button());
  71.                         this->label1 = (gcnew System::Windows::Forms::Label());
  72.                         this->textBox1 = (gcnew System::Windows::Forms::TextBox());
  73.                         this->textBox2 = (gcnew System::Windows::Forms::TextBox());
  74.                         this->textBox3 = (gcnew System::Windows::Forms::TextBox());
  75.                         this->label2 = (gcnew System::Windows::Forms::Label());
  76.                         this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
  77.                         this->radioButton1 = (gcnew System::Windows::Forms::RadioButton());
  78.                         this->radioButton2 = (gcnew System::Windows::Forms::RadioButton());
  79.                         this->radioButton3 = (gcnew System::Windows::Forms::RadioButton());
  80.                         this->radioButton4 = (gcnew System::Windows::Forms::RadioButton());
  81.                         this->groupBox1->SuspendLayout();
  82.                         this->SuspendLayout();
  83.                         //
  84.                         // button1
  85.                         //
  86.                         this->button1->Location = System::Drawing::Point(366, 218);
  87.                         this->button1->Name = L"button1";
  88.                         this->button1->Size = System::Drawing::Size(75, 23);
  89.                         this->button1->TabIndex = 0;
  90.                         this->button1->Text = L"Oblicz";
  91.                         this->button1->UseVisualStyleBackColor = true;
  92.                         this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
  93.                         //
  94.                         // label1
  95.                         //
  96.                         this->label1->AutoSize = true;
  97.                         this->label1->Location = System::Drawing::Point(197, 173);
  98.                         this->label1->Name = L"label1";
  99.                         this->label1->Size = System::Drawing::Size(13, 13);
  100.                         this->label1->TabIndex = 1;
  101.                         this->label1->Text = L"+";
  102.                         this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click);
  103.                         //
  104.                         // textBox1
  105.                         //
  106.                         this->textBox1->Location = System::Drawing::Point(91, 170);
  107.                         this->textBox1->Name = L"textBox1";
  108.                         this->textBox1->Size = System::Drawing::Size(100, 20);
  109.                         this->textBox1->TabIndex = 2;
  110.                         //
  111.                         // textBox2
  112.                         //
  113.                         this->textBox2->Location = System::Drawing::Point(216, 170);
  114.                         this->textBox2->Name = L"textBox2";
  115.                         this->textBox2->Size = System::Drawing::Size(100, 20);
  116.                         this->textBox2->TabIndex = 3;
  117.                         //
  118.                         // textBox3
  119.                         //
  120.                         this->textBox3->Location = System::Drawing::Point(341, 170);
  121.                         this->textBox3->Name = L"textBox3";
  122.                         this->textBox3->Size = System::Drawing::Size(100, 20);
  123.                         this->textBox3->TabIndex = 4;
  124.                         this->textBox3->TextChanged += gcnew System::EventHandler(this, &Form1::textBox3_TextChanged);
  125.                         //
  126.                         // label2
  127.                         //
  128.                         this->label2->AutoSize = true;
  129.                         this->label2->Location = System::Drawing::Point(322, 173);
  130.                         this->label2->Name = L"label2";
  131.                         this->label2->Size = System::Drawing::Size(13, 13);
  132.                         this->label2->TabIndex = 1;
  133.                         this->label2->Text = L"=";
  134.                         //
  135.                         // groupBox1
  136.                         //
  137.                         this->groupBox1->Controls->Add(this->radioButton4);
  138.                         this->groupBox1->Controls->Add(this->radioButton3);
  139.                         this->groupBox1->Controls->Add(this->radioButton2);
  140.                         this->groupBox1->Controls->Add(this->radioButton1);
  141.                         this->groupBox1->Location = System::Drawing::Point(183, 29);
  142.                         this->groupBox1->Name = L"groupBox1";
  143.                         this->groupBox1->Size = System::Drawing::Size(152, 125);
  144.                         this->groupBox1->TabIndex = 5;
  145.                         this->groupBox1->TabStop = false;
  146.                         this->groupBox1->Text = L"groupBox1";
  147.                         this->groupBox1->Enter += gcnew System::EventHandler(this, &Form1::groupBox1_Enter);
  148.                         //
  149.                         // radioButton1
  150.                         //
  151.                         this->radioButton1->AutoSize = true;
  152.                         this->radioButton1->Location = System::Drawing::Point(55, 19);
  153.                         this->radioButton1->Name = L"radioButton1";
  154.                         this->radioButton1->Size = System::Drawing::Size(31, 17);
  155.                         this->radioButton1->TabIndex = 0;
  156.                         this->radioButton1->TabStop = true;
  157.                         this->radioButton1->Text = L"+";
  158.                         this->radioButton1->UseVisualStyleBackColor = true;
  159.                         this->radioButton1->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton1_CheckedChanged);
  160.                         //
  161.                         // radioButton2
  162.                         //
  163.                         this->radioButton2->AutoSize = true;
  164.                         this->radioButton2->Location = System::Drawing::Point(55, 42);
  165.                         this->radioButton2->Name = L"radioButton2";
  166.                         this->radioButton2->Size = System::Drawing::Size(28, 17);
  167.                         this->radioButton2->TabIndex = 1;
  168.                         this->radioButton2->TabStop = true;
  169.                         this->radioButton2->Text = L"-";
  170.                         this->radioButton2->UseVisualStyleBackColor = true;
  171.                         //
  172.                         // radioButton3
  173.                         //
  174.                         this->radioButton3->AutoSize = true;
  175.                         this->radioButton3->Location = System::Drawing::Point(55, 65);
  176.                         this->radioButton3->Name = L"radioButton3";
  177.                         this->radioButton3->Size = System::Drawing::Size(29, 17);
  178.                         this->radioButton3->TabIndex = 2;
  179.                         this->radioButton3->TabStop = true;
  180.                         this->radioButton3->Text = L"*";
  181.                         this->radioButton3->UseVisualStyleBackColor = true;
  182.                         //
  183.                         // radioButton4
  184.                         //
  185.                         this->radioButton4->AutoSize = true;
  186.                         this->radioButton4->Location = System::Drawing::Point(55, 88);
  187.                         this->radioButton4->Name = L"radioButton4";
  188.                         this->radioButton4->Size = System::Drawing::Size(30, 17);
  189.                         this->radioButton4->TabIndex = 3;
  190.                         this->radioButton4->TabStop = true;
  191.                         this->radioButton4->Text = L"/";
  192.                         this->radioButton4->UseVisualStyleBackColor = true;
  193.                         //
  194.                         // Form1
  195.                         //
  196.                         this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  197.                         this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  198.                         this->ClientSize = System::Drawing::Size(604, 326);
  199.                         this->Controls->Add(this->groupBox1);
  200.                         this->Controls->Add(this->textBox3);
  201.                         this->Controls->Add(this->textBox2);
  202.                         this->Controls->Add(this->textBox1);
  203.                         this->Controls->Add(this->label2);
  204.                         this->Controls->Add(this->label1);
  205.                         this->Controls->Add(this->button1);
  206.                         this->Name = L"Form1";
  207.                         this->Text = L"Form1";
  208.                         this->groupBox1->ResumeLayout(false);
  209.                         this->groupBox1->PerformLayout();
  210.                         this->ResumeLayout(false);
  211.                         this->PerformLayout();
  212.  
  213.                 }
  214. #pragma endregion
  215.         private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e)
  216.                          {
  217.                                  if(RadioButton1->Checked){
  218.                                  textBox3->Text=System::Convert::ToString(System::Convert::ToDouble(textBox1->Text)+System::Convert::ToDouble(textBox2->Text))};
  219.                                  if(RadioButton2->Checked){
  220.                                  textBox3->Text=System::Convert::ToString(System::Convert::ToDouble(textBox1->Text)-System::Convert::ToDouble(textBox2->Text))};
  221.                                  if(RadioButton3->Checked){
  222.                                  textBox3->Text=System::Convert::ToString(System::Convert::ToDouble(textBox1->Text)*System::Convert::ToDouble(textBox2->Text))};
  223.                                  if(RadioButton4->Checked){
  224.                                  textBox3->Text=System::Convert::ToString(System::Convert::ToDouble(textBox1->Text)/System::Convert::ToDouble(textBox2->Text))};
  225.  
  226.                                
  227.                          }
  228.         private: System::Void label1_Click(System::Object^  sender, System::EventArgs^  e) {
  229.                          }
  230. private: System::Void textBox3_TextChanged(System::Object^  sender, System::EventArgs^  e)
  231.                  {
  232.                        
  233.                  }
  234. private: System::Void groupBox1_Enter(System::Object^  sender, System::EventArgs^  e) {
  235.                  }
  236. private: System::Void radioButton1_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
  237.                  }
  238. };
  239. }