#pragma once namespace InitialForm1 { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing;
/// /// MyForm の概要 /// public ref class MyForm : public System::Windows::Forms::Form { public: MyForm(void) { InitializeComponent(); // //TODO: ここにコンストラクター コードを追加します // } protected: /// /// 使用中のリソースをすべてクリーンアップします。 /// ~MyForm() { if (components) { delete components; } } private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::TextBox^ textBox1; private: System::ComponentModel::IContainer^ components; protected: private /// /// 必要なデザイナー変数です。 ///
#pragma region Windows Form Designer generated code /// /// デザイナー サポートに必要なメソッドです。このメソッドの内容を /// コード エディターで変更しないでください。 /// void InitializeComponent(void) { this->button1 = (gcnew System::Windows::Forms::Button()); this->button2 = (gcnew System::Windows::Forms::Button()); this->textBox1 = (gcnew System::Windows::Forms::TextBox()); this->SuspendLayout(); // // button1 // this->button1->Location = System::Drawing::Point(203, 12); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(63, 27); this->button1->TabIndex = 0; this->button1->Text = L"button1"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click); // // button2 // this->button2->Location = System::Drawing::Point(203, 47); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(62, 23); this->button2->TabIndex = 1; this->button2->Text = L"button2"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &MyForm::button2_Click); // // textBox1 // this->textBox1->Location = System::Drawing::Point(26, 12); this->textBox1->Name = L"textBox1"; this->textBox1->Size = System::Drawing::Size(124, 19); this->textBox1->TabIndex = 2; // // MyForm // this->AutoScaleDimensions = System::Drawing::SizeF(6, 12); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(292, 81); this->Controls->Add(this->textBox1); this->Controls->Add(this->button2); this->Controls->Add(this->button1); this->Name = L"MyForm"; this->Text = L"MyForm"; this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load); this->ResumeLayout(false); this->PerformLayout(); } #pragma endregion private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) { this->textBox1->Text = "Initial"; } private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { this->textBox1->Text = "Button1"; } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { this->textBox1->Text = "Button2"; } }; } |
0 件のコメント:
コメントを投稿