natarajadithyan

My Program

Jul 21st, 2012
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.97 KB | None | 0 0
  1. #pragma once
  2.  
  3. namespace HelloWorld {
  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.     using namespace std;
  12.     using namespace System::Runtime::InteropServices;
  13.  
  14.     /// <summary>
  15.     /// Summary for Form1
  16.     /// </summary>
  17.     public ref class Form1 : public System::Windows::Forms::Form
  18.     {
  19.     public:
  20.         Form1(void)
  21.         {
  22.             InitializeComponent();
  23.             //
  24.             //TODO: Add the constructor code here
  25.             //
  26.         }
  27.  
  28.     protected:
  29.         /// <summary>
  30.         /// Clean up any resources being used.
  31.         /// </summary>
  32.         ~Form1()
  33.         {
  34.             if (components)
  35.             {
  36.                 delete components;
  37.             }
  38.         }
  39.     private: System::Windows::Forms::Label^  label1;
  40.     protected:
  41.     private: System::Windows::Forms::TextBox^  textBox1;
  42.     private: System::Windows::Forms::Button^  button1;
  43.     private: System::Windows::Forms::Label^  label2;
  44.  
  45.     private:
  46.         /// <summary>
  47.         /// Required designer variable.
  48.         /// </summary>
  49.         System::ComponentModel::Container ^components;
  50.  
  51. #pragma region Windows Form Designer generated code
  52.         /// <summary>
  53.         /// Required method for Designer support - do not modify
  54.         /// the contents of this method with the code editor.
  55.         /// </summary>
  56.         void InitializeComponent(void)
  57.         {
  58.             this->label1 = (gcnew System::Windows::Forms::Label());
  59.             this->textBox1 = (gcnew System::Windows::Forms::TextBox());
  60.             this->button1 = (gcnew System::Windows::Forms::Button());
  61.             this->label2 = (gcnew System::Windows::Forms::Label());
  62.             this->SuspendLayout();
  63.             //
  64.             // label1
  65.             //
  66.             this->label1->AutoSize = true;
  67.             this->label1->Location = System::Drawing::Point(88, 9);
  68.             this->label1->Name = L"label1";
  69.             this->label1->Size = System::Drawing::Size(105, 13);
  70.             this->label1->TabIndex = 0;
  71.             this->label1->Text = L"What is Your Name\?";
  72.             this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click);
  73.             //
  74.             // textBox1
  75.             //
  76.             this->textBox1->Location = System::Drawing::Point(12, 36);
  77.             this->textBox1->Name = L"textBox1";
  78.             this->textBox1->Size = System::Drawing::Size(260, 20);
  79.             this->textBox1->TabIndex = 1;
  80.             this->textBox1->TextChanged += gcnew System::EventHandler(this, &Form1::textBox1_TextChanged);
  81.             //
  82.             // button1
  83.             //
  84.             this->button1->Location = System::Drawing::Point(12, 81);
  85.             this->button1->Name = L"button1";
  86.             this->button1->Size = System::Drawing::Size(260, 23);
  87.             this->button1->TabIndex = 2;
  88.             this->button1->Text = L"Done";
  89.             this->button1->UseVisualStyleBackColor = true;
  90.             this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
  91.             //
  92.             // label2
  93.             //
  94.             this->label2->AutoSize = true;
  95.             this->label2->Location = System::Drawing::Point(125, 135);
  96.             this->label2->Name = L"label2";
  97.             this->label2->Size = System::Drawing::Size(10, 13);
  98.             this->label2->TabIndex = 3;
  99.             this->label2->Text = L".";
  100.             this->label2->Click += gcnew System::EventHandler(this, &Form1::label2_Click);
  101.             //
  102.             // Form1
  103.             //
  104.             this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  105.             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  106.             this->ClientSize = System::Drawing::Size(284, 262);
  107.             this->Controls->Add(this->label2);
  108.             this->Controls->Add(this->button1);
  109.             this->Controls->Add(this->textBox1);
  110.             this->Controls->Add(this->label1);
  111.             this->Name = L"Form1";
  112.             this->Text = L"Hello World";
  113.             this->ResumeLayout(false);
  114.             this->PerformLayout();
  115.  
  116.         }
  117. #pragma endregion
  118.    
  119.     private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
  120.                  
  121.              }
  122.     private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
  123.                  label2 -> Text = "Hello " -> textBox1.Text;
  124.              }
  125.     private: System::Void label2_Click(System::Object^  sender, System::EventArgs^  e) {
  126.              }
  127. private: System::Void label1_Click(System::Object^  sender, System::EventArgs^  e) {
  128.          }
  129. };
  130. }
Advertisement
Add Comment
Please, Sign In to add comment