summaryrefslogtreecommitdiff
path: root/task01/Guschin/MyForm.h
diff options
context:
space:
mode:
authorAndrew Guschin <saintruler@gmail.com>2020-11-09 23:28:49 +0300
committerAndrew Guschin <saintruler@gmail.com>2020-11-09 23:28:49 +0300
commit0408d33694635cdc28db23c9c6388bd916626bde (patch)
tree843f2e61b8f5652ff3b2f19779820c223403ca7d /task01/Guschin/MyForm.h
Добавил первые 4 задания
Diffstat (limited to 'task01/Guschin/MyForm.h')
-rw-r--r--task01/Guschin/MyForm.h171
1 files changed, 171 insertions, 0 deletions
diff --git a/task01/Guschin/MyForm.h b/task01/Guschin/MyForm.h
new file mode 100644
index 0000000..f1d2add
--- /dev/null
+++ b/task01/Guschin/MyForm.h
@@ -0,0 +1,171 @@
+#pragma once
+
+namespace Guschin {
+
+ 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>
+ /// MyForm
+ /// </summary>
+ public ref class MyForm : public System::Windows::Forms::Form
+ {
+ public:
+ MyForm(void)
+ {
+ InitializeComponent();
+ //
+ //TODO:
+ //
+ }
+
+ protected:
+ /// <summary>
+ /// .
+ /// </summary>
+ ~MyForm()
+ {
+ if (components)
+ {
+ delete components;
+ }
+ }
+ private: System::Windows::Forms::Label^ label1;
+ private: System::Windows::Forms::TextBox^ textBox1;
+ private: System::Windows::Forms::Label^ label2;
+ private: System::Windows::Forms::Button^ button1;
+ private: System::Windows::Forms::Label^ currency;
+
+ protected:
+
+ protected:
+
+ private:
+ /// <summary>
+ /// .
+ /// </summary>
+ System::ComponentModel::Container^ components;
+
+#pragma region Windows Form Designer generated code
+ /// <summary>
+ ///
+ /// .
+ /// </summary>
+ void InitializeComponent(void)
+ {
+ this->label1 = (gcnew System::Windows::Forms::Label());
+ this->textBox1 = (gcnew System::Windows::Forms::TextBox());
+ this->label2 = (gcnew System::Windows::Forms::Label());
+ this->button1 = (gcnew System::Windows::Forms::Button());
+ this->currency = (gcnew System::Windows::Forms::Label());
+ this->SuspendLayout();
+ //
+ // label1
+ //
+ this->label1->BackColor = System::Drawing::SystemColors::Control;
+ this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(204)));
+ this->label1->Location = System::Drawing::Point(29, 33);
+ this->label1->Name = L"label1";
+ this->label1->Size = System::Drawing::Size(442, 90);
+ this->label1->TabIndex = 0;
+ this->label1->Text = L", . "
+ L" . , - "
+ L" . .";
+ this->label1->Click += gcnew System::EventHandler(this, &MyForm::label1_Click);
+ //
+ // textBox1
+ //
+ this->textBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 13, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(204)));
+ this->textBox1->Location = System::Drawing::Point(102, 252);
+ this->textBox1->Name = L"textBox1";
+ this->textBox1->Size = System::Drawing::Size(189, 27);
+ this->textBox1->TabIndex = 1;
+ //
+ // label2
+ //
+ this->label2->AutoSize = true;
+ this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(204)));
+ this->label2->Location = System::Drawing::Point(30, 255);
+ this->label2->Name = L"label2";
+ this->label2->Size = System::Drawing::Size(66, 20);
+ this->label2->TabIndex = 2;
+ this->label2->Text = L": ";
+ //
+ // button1
+ //
+ this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(204)));
+ this->button1->Location = System::Drawing::Point(358, 248);
+ this->button1->Name = L"button1";
+ this->button1->Size = System::Drawing::Size(103, 37);
+ this->button1->TabIndex = 3;
+ this->button1->Text = L"";
+ this->button1->UseVisualStyleBackColor = true;
+ //
+ // currency
+ //
+ this->currency->AutoSize = true;
+ this->currency->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
+ static_cast<System::Byte>(204)));
+ this->currency->Location = System::Drawing::Point(297, 258);
+ this->currency->Name = L"currency";
+ this->currency->Size = System::Drawing::Size(55, 17);
+ this->currency->TabIndex = 4;
+ this->currency->Text = L"";
+ //
+ // MyForm
+ //
+ this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
+ this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
+ this->ClientSize = System::Drawing::Size(500, 500);
+ this->Controls->Add(this->currency);
+ this->Controls->Add(this->button1);
+ this->Controls->Add(this->label2);
+ this->Controls->Add(this->textBox1);
+ this->Controls->Add(this->label1);
+ this->DoubleBuffered = true;
+ this->Name = L"MyForm";
+ this->Text = L" ";
+ this->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &MyForm::MyForm_Paint);
+ this->Resize += gcnew System::EventHandler(this, &MyForm::MyForm_Resize);
+ this->ResumeLayout(false);
+ this->PerformLayout();
+
+ }
+#pragma endregion
+ private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {
+ }
+ private: System::Void MyForm_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
+ Graphics^ g = e->Graphics;
+ g->Clear(Color::Pink);
+
+ Pen^ redPen = gcnew Pen(Color::Red);
+ redPen->Width = 6;
+ g->DrawLine(redPen, 0, 0, this->ClientRectangle.Width, this->ClientRectangle.Height);
+
+ Pen^ bluePen = gcnew Pen(Color::Blue, 10);
+ g->DrawLine(bluePen, 90, 50, ClientRectangle.Width, 80);
+
+ SolidBrush^ drawBrush = gcnew SolidBrush(Color::Green);
+ System::Drawing::Font^ drawFont = gcnew System::Drawing::Font("Comic Sans MS", 20);
+ g->DrawString(" ", drawFont, drawBrush, 40, 400);
+
+ Pen^ sqarePen = gcnew Pen(Color::Green, 5);
+ g->DrawLine(sqarePen, 0, ClientRectangle.Height / 3, ClientRectangle.Width / 3 * 2, 0);
+ g->DrawLine(sqarePen, ClientRectangle.Width / 3 * 2, 0, ClientRectangle.Width, ClientRectangle.Height / 3 * 2);
+ g->DrawLine(sqarePen, ClientRectangle.Width, ClientRectangle.Height / 3 * 2, ClientRectangle.Width / 3, ClientRectangle.Height);
+ g->DrawLine(sqarePen, ClientRectangle.Width / 3, ClientRectangle.Height, 0, ClientRectangle.Height / 3);
+
+ }
+ private: System::Void MyForm_Resize(System::Object^ sender, System::EventArgs^ e) {
+ this->Refresh();
+ }
+ };
+}