
#pragma once
namespace My9 {
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 for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
///
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
///
/// Clean up any resources being used.
///
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ lblResult;
protected:
private: System::Windows::Forms::Button^ BtnResult;
private: System::Windows::Forms::Label^ lblNum2;
private: System::Windows::Forms::Label^ lblNum1;
private: System::Windows::Forms::Label^ lblOper;
private: System::Windows::Forms::Label^ label1;
protected:
protected:
private:
///
/// Required designer variable.
///
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
this->lblResult = (gcnew System::Windows::Forms::Label());
this->BtnResult = (gcnew System::Windows::Forms::Button());
this->lblNum2 = (gcnew System::Windows::Forms::Label());
this->lblNum1 = (gcnew System::Windows::Forms::Label());
this->lblOper = (gcnew System::Windows::Forms::Label());
this->label1 = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// lblResult
//
this->lblResult->AutoSize = true;
this->lblResult->Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, static_cast
System::Drawing::GraphicsUnit::Point, static_cast
this->lblResult->ForeColor = System::Drawing::Color::FromArgb(static_cast
static_cast
this->lblResult->Location = System::Drawing::Point(104, 128);
this->lblResult->Name = L"lblResult";
this->lblResult->Size = System::Drawing::Size(70, 22);
this->lblResult->TabIndex = 2;
this->lblResult->Text = L"............";
//
// BtnResult
//
this->BtnResult->Location = System::Drawing::Point(28, 176);
this->BtnResult->Name = L"BtnResult";
this->BtnResult->Size = System::Drawing::Size(252, 32);
this->BtnResult->TabIndex = 5;
this->BtnResult->Text = L"Show Result";
this->BtnResult->UseVisualStyleBackColor = true;
this->BtnResult->Click += gcnew System::EventHandler(this, &Form1::BtnResult_Click);
//
// lblNum2
//
this->lblNum2->AutoSize = true;
this->lblNum2->Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, static_cast
System::Drawing::GraphicsUnit::Point, static_cast
this->lblNum2->ForeColor = System::Drawing::Color::Blue;
this->lblNum2->Location = System::Drawing::Point(115, 68);
this->lblNum2->Name = L"lblNum2";
this->lblNum2->Size = System::Drawing::Size(59, 22);
this->lblNum2->TabIndex = 6;
this->lblNum2->Text = L"label3";
//
// lblNum1
//
this->lblNum1->AutoSize = true;
this->lblNum1->Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast
this->lblNum1->ForeColor = System::Drawing::Color::Yellow;
this->lblNum1->Location = System::Drawing::Point(115, 19);
this->lblNum1->Name = L"lblNum1";
this->lblNum1->Size = System::Drawing::Size(59, 22);
this->lblNum1->TabIndex = 7;
this->lblNum1->Text = L"label3";
//
// lblOper
//
this->lblOper->AutoSize = true;
this->lblOper->Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast
this->lblOper->Location = System::Drawing::Point(180, 47);
this->lblOper->Name = L"lblOper";
this->lblOper->Size = System::Drawing::Size(21, 22);
this->lblOper->TabIndex = 8;
this->lblOper->Text = L"+";
//
// label1
//
this->label1->AutoSize = true;
this->label1->Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast
this->label1->ForeColor = System::Drawing::Color::Black;
this->label1->Location = System::Drawing::Point(133, 90);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(21, 22);
this->label1->TabIndex = 9;
this->label1->Text = L"=";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(292, 211);
this->Controls->Add(this->label1);
this->Controls->Add(this->lblOper);
this->Controls->Add(this->lblNum1);
this->Controls->Add(this->lblNum2);
this->Controls->Add(this->BtnResult);
this->Controls->Add(this->lblResult);
this->ForeColor = System::Drawing::Color::Black;
this->Name = L"Form1";
this->Text = L"Form1";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
int cNum1;
int cNum2;
int cResult;
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
cNum1=935800;
cNum2=108564;
lblNum1->Text=cNum1.ToString();
lblNum2->Text=cNum2.ToString();
this->BackColor=Color::Pink;
this->FormBorderStyle=Windows::Forms::FormBorderStyle::FixedToolWindow;
}
private: System::Void BtnResult_Click(System::Object^ sender, System::EventArgs^ e) {
cResult=cNum1+cNum2;
lblResult->Text=cResult.ToString();
}
};
}