#pragma once ///////////////////////////////////////////////////////////////////// // MessageForm.h - Child Form declaration for clearing messages // // // // Jim Fawcett, CSE687 - Object Oriented Design, Spring 2006 // ///////////////////////////////////////////////////////////////////// #include "../TestForm/Form1.h" using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; namespace TestForm { /// /// Summary for MessageForm /// /// 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 MessageForm : public System::Windows::Forms::Form { public: MessageForm(Form1^ pMainForm) : pForm(pMainForm) { InitializeComponent(); } protected: ~MessageForm() { if (components) { delete components; } } private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::GroupBox^ groupBox1; protected: private: 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->button1 = (gcnew System::Windows::Forms::Button()); this->groupBox1 = (gcnew System::Windows::Forms::GroupBox()); this->groupBox1->SuspendLayout(); this->SuspendLayout(); // // button1 // this->button1->Anchor = static_cast((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom) | System::Windows::Forms::AnchorStyles::Left) | System::Windows::Forms::AnchorStyles::Right)); this->button1->Location = System::Drawing::Point(64, 35); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(75, 28); this->button1->TabIndex = 0; this->button1->Text = L"Clear"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &MessageForm::button1_Click); // // groupBox1 // this->groupBox1->Anchor = static_cast((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom) | System::Windows::Forms::AnchorStyles::Left) | System::Windows::Forms::AnchorStyles::Right)); this->groupBox1->Controls->Add(this->button1); this->groupBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast(0))); this->groupBox1->Location = System::Drawing::Point(45, 39); this->groupBox1->Name = L"groupBox1"; this->groupBox1->Size = System::Drawing::Size(200, 85); this->groupBox1->TabIndex = 1; this->groupBox1->TabStop = false; this->groupBox1->Text = L"Clear Messages"; // // MessageForm // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(292, 201); this->Controls->Add(this->groupBox1); this->Name = L"MessageForm"; this->Text = L"MessageForm"; this->Load += gcnew System::EventHandler(this, &MessageForm::MessageForm_Load); this->groupBox1->ResumeLayout(false); this->ResumeLayout(false); } #pragma endregion private: System::Void MessageForm_Load(System::Object^ sender, System::EventArgs^ e) { } System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { pForm->ClearMessages(); this->Close(); } Form1^ pForm; }; }