add.h
#pragma once #include "MyForm.h" namespace AnimList { 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> /// Summary for Add /// </summary> public ref class Add : public System::Windows::Forms::Form { public: Add(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~Add() { if (components) { delete components; } } private: System::Windows::Forms::Button^ button1; protected: private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::TextBox^ textBox1; private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Add::typeid)); 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(103, 115); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(204, 62); this->button1->TabIndex = 0; this->button1->Text = L"Submit"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &Add::button1_Click); // // button2 // this->button2->Location = System::Drawing::Point(349, 115); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(204, 62); this->button2->TabIndex = 1; this->button2->Text = L"Cancel"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Add::button2_Click); // // textBox1 // this->textBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 22, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0))); this->textBox1->Location = System::Drawing::Point(12, 12); this->textBox1->Name = L"textBox1"; this->textBox1->Size = System::Drawing::Size(617, 57); this->textBox1->TabIndex = 2; this->textBox1->TextChanged += gcnew System::EventHandler(this, &Add::textBox1_TextChanged); // // Add // this->AutoScaleDimensions = System::Drawing::SizeF(9, 20); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"$this.BackgroundImage"))); this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch; this->ClientSize = System::Drawing::Size(641, 219); this->Controls->Add(this->textBox1); this->Controls->Add(this->button2); this->Controls->Add(this->button1); this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog; this->MaximizeBox = false; this->Name = L"Add"; this->Text = L"Add"; this->ResumeLayout(false); this->PerformLayout(); } #pragma endregion private: System::Void textBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) { } private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { MyForm^ form = gcnew MyForm(); if (textBox1 == nullptr) return; else { } } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { System::Diagnostics::Debug::WriteLine("button2_Click event triggered"); this->Close(); } }; }
Leave a Comment