ΠΠ°ΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅.
Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ Ρ ΠΌΠ°ΡΠ΅ΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΌΠΈ ΡΡΠ½ΠΊΡΠΈΡΠΌΠΈ
Π ΡΠ΅Π·ΡΠ»ΡΡΠ°ΡΠ΅ ΡΠΎΠ·Π΄Π°Π½ΠΎ ΡΠ°Π±ΠΎΡΠΎΡΠΏΠΎΡΠΎΠ±Π½ΠΎΠ΅ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ «ΠΠΎΡΡΡΠΎΠ΅Π½ΠΈΠ΅ Π³ΡΠ°ΡΠΈΠΊΠΎΠ² ΠΌΠ°ΡΠ΅ΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΡ ΡΡΠ½ΠΊΡΠΈΠΉ». Π’Π°ΠΊΠΆΠ΅ ΠΏΡΠΈ ΠΏΡΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠΈ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ Π½Π΅ Π±ΡΠ»ΠΎ ΠΎΠ±Π½Π°ΡΡΠΆΠ΅Π½ΠΎ ΠΎΡΠΈΠ±ΠΎΠΊ. ΠΡΠ΅ ΠΏΠΎΡΡΠ°Π²Π»Π΅Π½Π½ΡΠ΅ Π·Π°Π΄Π°ΡΠΈ ΡΠ°ΡΡΠΌΠΎΡΡΠ΅Π½Ρ, ΡΠ΅Π»Ρ ΠΊΡΡΡΠΎΠ²ΠΎΠΉ ΡΠ°Π±ΠΎΡΡ Π΄ΠΎΡΡΠΈΠ³Π½ΡΡΠ°. ΠΡΠ°ΡΠΈΠ½Π° Π. Π. ΠΠ±ΡΠ΅ΠΊΡΠ½ΠΎ-ΠΎΡΠΈΠ΅Π½ΡΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠ΅ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π² Π‘++: Π»Π΅ΠΊΡΠΈΠΈ ΠΈ ΡΠΏΡΠ°ΠΆΠ½Π΅Π½ΠΈΡ: ΡΡΠ΅Π±Π½ΠΎΠ΅ ΠΏΠΎΡΠΎΠ±ΠΈΠ΅ / Π. Π. ΠΡΠ°ΡΠΈΠ½Π°. — Π.: Π’Π΅Π»Π΅ΠΊΠΎΠΌ, 2012. — 319 Ρ. Π Ρ ΠΎΠ΄Π΅ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ… Π§ΠΈΡΠ°ΡΡ Π΅ΡΡ >
ΠΠ°ΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅. Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ Ρ ΠΌΠ°ΡΠ΅ΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΌΠΈ ΡΡΠ½ΠΊΡΠΈΡΠΌΠΈ (ΡΠ΅ΡΠ΅ΡΠ°Ρ, ΠΊΡΡΡΠΎΠ²Π°Ρ, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½ΡΡΠΎΠ»ΡΠ½Π°Ρ)
Π Ρ ΠΎΠ΄Π΅ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ ΠΊΡΡΡΠΎΠ²ΠΎΠΉ ΡΠ°Π±ΠΎΡΡ Π±ΡΠ» ΡΠΎΠ±ΡΠ°Π½ ΠΈ ΠΈΠ·ΡΡΠ΅Π½ ΡΠ΅ΠΎΡΠ΅ΡΠΈΡΠ΅ΡΠΊΠΈΠΉ ΠΌΠ°ΡΠ΅ΡΠΈΠ°Π» ΠΏΠΎ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ Ρ Π³ΡΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΌ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡΠΎΠΌ.
Π Π΅Π°Π»ΠΈΠ·ΡΡ ΡΠ΅Π»Ρ Π΄Π°Π½Π½ΠΎΠ³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ°, Π±ΡΠ» ΡΠ»ΡΡΡΠ΅Π½ Π½Π°Π²ΡΠΊ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ ΡΡΠ΅Π΄Ρ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Visual Studio 2015.
Π ΡΠ΅Π·ΡΠ»ΡΡΠ°ΡΠ΅ ΡΠΎΠ·Π΄Π°Π½ΠΎ ΡΠ°Π±ΠΎΡΠΎΡΠΏΠΎΡΠΎΠ±Π½ΠΎΠ΅ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ «ΠΠΎΡΡΡΠΎΠ΅Π½ΠΈΠ΅ Π³ΡΠ°ΡΠΈΠΊΠΎΠ² ΠΌΠ°ΡΠ΅ΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΡ ΡΡΠ½ΠΊΡΠΈΠΉ». Π’Π°ΠΊΠΆΠ΅ ΠΏΡΠΈ ΠΏΡΠΎΠ²Π΅Π΄Π΅Π½ΠΈΠΈ ΡΠ΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ Π½Π΅ Π±ΡΠ»ΠΎ ΠΎΠ±Π½Π°ΡΡΠΆΠ΅Π½ΠΎ ΠΎΡΠΈΠ±ΠΎΠΊ. ΠΡΠ΅ ΠΏΠΎΡΡΠ°Π²Π»Π΅Π½Π½ΡΠ΅ Π·Π°Π΄Π°ΡΠΈ ΡΠ°ΡΡΠΌΠΎΡΡΠ΅Π½Ρ, ΡΠ΅Π»Ρ ΠΊΡΡΡΠΎΠ²ΠΎΠΉ ΡΠ°Π±ΠΎΡΡ Π΄ΠΎΡΡΠΈΠ³Π½ΡΡΠ°.
Π‘ΠΠΠ‘ΠΠ ΠΠ‘ΠΠΠΠ¬ΠΠΠΠΠΠΠ«Π₯ ΠΠ‘Π’ΠΠ§ΠΠΠΠΠ
- 1. ΠΡΠ°ΡΠΈΠ½Π° Π. Π. ΠΠ±ΡΠ΅ΠΊΡΠ½ΠΎ-ΠΎΡΠΈΠ΅Π½ΡΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠ΅ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π² Π‘++: Π»Π΅ΠΊΡΠΈΠΈ ΠΈ ΡΠΏΡΠ°ΠΆΠ½Π΅Π½ΠΈΡ: ΡΡΠ΅Π±Π½ΠΎΠ΅ ΠΏΠΎΡΠΎΠ±ΠΈΠ΅ / Π. Π. ΠΡΠ°ΡΠΈΠ½Π°. — Π.: Π’Π΅Π»Π΅ΠΊΠΎΠΌ, 2012. — 319 Ρ.
- 2. ΠΠΎΠ΄Π±Π΅Π»ΡΡΠΊΠΈΠΉ Π. Π. ΠΡΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Π½Π° ΡΠ·ΡΠΊΠ΅ Π‘ΠΈ / Π.Π. ΠΠΎΠ΄Π±Π΅Π»ΡΡΠΊΠΈΠΉΠ.: ΠΡΠ΅ΡΡ, 2012. — 384 Ρ.
- 3. ΠΠΎΠ³ΠΈΠ½ΠΎΠ²Π° Π€. Π‘. ΠΠ±ΡΠ΅ΠΊΡΠ½ΠΎ-ΠΎΡΠΈΠ΅Π½ΡΠΈΡΠΎΠ²Π°Π½Π½ΡΠ΅ ΠΌΠ΅ΡΠΎΠ΄Ρ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ. / Π€.Π‘. ΠΠΎΠ³ΠΈΠ½ΠΎΠ²Π°— Π.: ΠΡΠ΅ΡΡ, 2012. — 208 Ρ.
- 4. ΠΠ°Π²Π»ΠΎΠ²ΡΠΊΠ°Ρ Π’. Π. «C/C++. ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π½Π° ΡΠ·ΡΠΊΠ΅ Π²ΡΡΠΎΠΊΠΎΠ³ΠΎ ΡΡΠΎΠ²Π½Ρ» / Π’. Π. ΠΠ°Π²Π»ΠΎΠ²ΡΠΊΠ°Ρ. — Π‘ΠΠ±.: ΠΠΈΡΠ΅Ρ, 2012 — 367 Ρ.
- 5. Π₯Π°Π±ΠΈΠ±ΡΠ»Π»ΠΈΠ½ Π. Π¨. «ΠΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π½Π° ΡΠ·ΡΠΊΠ΅ Π²ΡΡΠΎΠΊΠΎΠ³ΠΎ ΡΡΠΎΠ²Π½Ρ. C/C++». / Π.Π¨. Π₯Π°Π±ΠΈΠ±ΡΠ»Π»ΠΈΠ½Π‘ΠΏΠ±.: ΠΠΈΡΠ΅Ρ, 2013 — 405 Ρ.
- 6. Π¨ΠΈΠ»Π΄Ρ Π. «C++ Π±Π°Π·ΠΎΠ²ΡΠΉ ΠΊΡΡΡ» / Π. Π¨ΠΈΠ»Π΄ΡΠ‘ΠΏΠ±.: ΠΠΈΡΠ΅Ρ, 2012 — 709 Ρ.
- 7. ΠΠ°Π²Π»ΠΎΠ²ΡΠΊΠ°Ρ Π’. Π. «C/C++. Π‘ΡΡΡΠΊΡΡΡΠ½ΠΎΠ΅ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅: ΠΡΠ°ΠΊΡΠΈΠΊΡΠΌ» / Π’.Π. ΠΠ°Π²Π»ΠΎΠ²ΡΠΊΠ°ΡΠ‘ΠΠ±.: ΠΠΈΡΠ΅Ρ, 2013 — 451 Ρ.
ΠΠ ΠΠΠΠΠΠΠΠ, Π ΠΠΎΠ΄ ΡΠ°ΠΉΠ»Π° MyForm. cpp:
#include «MyForm.h» .
using namespace System;
using namespace System: Windows:Forms;
[STAThread].
void main (array^ arg) {.
Application:EnableVisualStyles ();
Application:SetCompatibleTextRenderingDefault (false);
ΠΡΠΎΠ΅ΠΊΡ1:MyForm form;
Application:Run (%form);
}.
System:Void ΠΡΠΎΠ΅ΠΊΡ1: MyForm:button2_Click (System:Object ^ sender, System: EventArgs ^ e).
{.
Points->Clear ();
pictureBox1->Invalidate ();
textBox2->Text = «» ;
textBox3->Text = «» ;
return System: Void ();
}.
System:Void ΠΡΠΎΠ΅ΠΊΡ1: MyForm:comboBox1_SelectedIndexChanged (System:Object ^ sender, System: EventArgs ^ e).
{.
textBox1->Text = (String^)comboBox1->SelectedItem;
/*switch (comboBox1->SelectedIndex).
{.
case 0: textBox1->Text = «Sin (x)»; break;
case 1: textBox1->Text = «Cos (x)»; break;
case 2: textBox1->Text = «Tg (x)»; break;
}*/.
MakeFunct ();
return System: Void ();
}.
ΠΠΎΠ΄ ΡΠ°ΠΉΠ»Π° MyForm. h:
#pragma once.
#include.
namespace ΠΡΠΎΠ΅ΠΊΡ1 {.
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.
{.
int count = 0;
private: System: Windows:Forms:PictureBox^ pictureBox1;
private: System: Windows:Forms:TextBox^ textBox1;
private: System: Windows:Forms:Label^ label1;
private: System: Windows:Forms:Button^ button2;
private: System: Windows:Forms:Label^ label2;
private: System: Windows:Forms:Label^ label3;
private: System: Windows:Forms:TextBox^ textBox2;
private: System: Windows:Forms:TextBox^ textBox3;
private: System: Windows:Forms:Label^ label4;
private: System: Windows:Forms:ComboBox^ comboBox1;
private: System: Windows:Forms:Label^ label5;
private: System: Windows:Forms:Label^ label6;
private: System: Windows:Forms:TextBox^ textBox4;
private: System: Windows:Forms:TextBox^ textBox5;
private: System: Windows:Forms:Label^ label7;
private: System: Windows:Forms:TextBox^ textBox6;
private: System: Windows:Forms:Label^ label8;
ArrayList^ Points = gcnew (ArrayList);
public:
MyForm (void).
{.
InitializeComponent ();
//TODO: Π΄ΠΎΠ±Π°Π²ΡΡΠ΅ ΠΊΠΎΠ΄ ΠΊΠΎΠ½ΡΡΡΡΠΊΡΠΎΡΠ°.
}.
protected:
/// ΠΡΠ²ΠΎΠ±ΠΎΠ΄ΠΈΡΡ Π²ΡΠ΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΠΌΡΠ΅ ΡΠ΅ΡΡΡΡΡ.
~MyForm ().
{.
if (components).
{.
delete components;
}.
}.
private: System: Windows:Forms:Button^ button1;
protected:
private:
/// ΠΠ±ΡΠ·Π°ΡΠ΅Π»ΡΠ½Π°Ρ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½Π°Ρ ΠΊΠΎΠ½ΡΡΡΡΠΊΡΠΎΡΠ°.
System:ComponentModel:Container ^components;
#pragma region Windows Form Designer generated code.
/// Π’ΡΠ΅Π±ΡΠ΅ΠΌΡΠΉ ΠΌΠ΅ΡΠΎΠ΄ Π΄Π»Ρ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠΈ ΠΊΠΎΠ½ΡΡΡΡΠΊΡΠΎΡΠ° — Π½Π΅ ΠΈΠ·ΠΌΠ΅Π½ΡΠΉΡΠ΅.
/// ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ ΡΡΠΎΠ³ΠΎ ΠΌΠ΅ΡΠΎΠ΄Π° Ρ ΠΏΠΎΠΌΠΎΡΡΡ ΡΠ΅Π΄Π°ΠΊΡΠΎΡΠ° ΠΊΠΎΠ΄Π°.
void InitializeComponent (void).
{.
this->button1 = (gcnew System: Windows:Forms:Button ());
this->pictureBox1 = (gcnew System: Windows:Forms:PictureBox ());
this->textBox1 = (gcnew System: Windows:Forms:TextBox ());
this->label1 = (gcnew System: Windows:Forms:Label ());
this->button2 = (gcnew System: Windows:Forms:Button ());
this->label2 = (gcnew System: Windows:Forms:Label ());
this->label3 = (gcnew System: Windows:Forms:Label ());
this->textBox2 = (gcnew System: Windows:Forms:TextBox ());
this->textBox3 = (gcnew System: Windows:Forms:TextBox ());
this->label4 = (gcnew System: Windows:Forms:Label ());
this->comboBox1 = (gcnew System: Windows:Forms:ComboBox ());
this->label5 = (gcnew System: Windows:Forms:Label ());
this->label6 = (gcnew System: Windows:Forms:Label ());
this->textBox4 = (gcnew System: Windows:Forms:TextBox ());
this->textBox5 = (gcnew System: Windows:Forms:TextBox ());
this->label7 = (gcnew System: Windows:Forms:Label ());
this->textBox6 = (gcnew System: Windows:Forms:TextBox ());
this->label8 = (gcnew System: Windows:Forms:Label ());
(cli:safe_cast (this->pictureBox1))->BeginInit ();
this->SuspendLayout ();
// button1.
this->button1->Font = (gcnew System: Drawing:Font (L" Microsoft Sans Serif", 8.25 °F, System: Drawing:FontStyle:Regular, System: Drawing:GraphicsUnit:Point,.
static_cast (204)));
this->button1->Location = System: Drawing:Point (318, 12);
this->button1->Name = L" button1″ ;
this->button1->Size = System: Drawing:Size (101, 20);
this->button1->TabIndex = 0;
this->button1->Text = L" ΠΠΎΡΡΡΠΎΠΈΡΡ" ;
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System: EventHandler (this, &MyForm:button1_Click);
// pictureBox1.
this->pictureBox1->Location = System: Drawing:Point (12, 39);
this->pictureBox1->Name = L" pictureBox1″ ;
this->pictureBox1->Size = System: Drawing:Size (300, 300);
this->pictureBox1->TabIndex = 9;
this->pictureBox1->TabStop = false;
this->pictureBox1->Paint += gcnew System: Windows:Forms:PaintEventHandler (this, &MyForm:pictureBox1_Paint);
// textBox1.
this->textBox1->Location = System: Drawing:Point (36, 13);
this->textBox1->Name = L" textBox1″ ;
this->textBox1->Size = System: Drawing:Size (276, 20);
this->textBox1->TabIndex = 10;
// label1.
this->label1->AutoSize = true;
this->label1->Location = System: Drawing:Point (12, 16);
this->label1->Name = L" label1″ ;
this->label1->Size = System: Drawing:Size (18, 13);
this->label1->TabIndex = 11;
this->label1->Text = L" y=";
// button2.
this->button2->Font = (gcnew System: Drawing:Font (L" Microsoft Sans Serif", 8.25 °F, System: Drawing:FontStyle:Regular, System: Drawing:GraphicsUnit:Point,.
static_cast (204)));
this->button2->Location = System: Drawing:Point (318, 39);
this->button2->Name = L" button2″ ;
this->button2->Size = System: Drawing:Size (101, 20);
this->button2->TabIndex = 12;
this->button2->Text = L" ΠΡΠΈΡΡΠΈΡΡ" ;
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System: EventHandler (this, &MyForm:button2_Click);
// label2.
this->label2->AutoSize = true;
this->label2->Location = System: Drawing:Point (12, 342);
this->label2->Name = L" label2″ ;
this->label2->Size = System: Drawing:Size (122, 13);
this->label2->TabIndex = 13;
this->label2->Text = L" ΠΠ±Π»Π°ΡΡΡ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΡ:" ;
// label3.
this->label3->AutoSize = true;
this->label3->Location = System: Drawing:Point (12, 364);
this->label3->Name = L" label3″ ;
this->label3->Size = System: Drawing:Size (17, 13);
this->label3->TabIndex = 14;
this->label3->Text = L" X:" ;
// textBox2.
this->textBox2->Location = System: Drawing:Point (35, 361);
this->textBox2->Name = L" textBox2″ ;
this->textBox2->Size = System: Drawing:Size (379, 20);
this->textBox2->TabIndex = 15;
// textBox3.
this->textBox3->Location = System: Drawing:Point (35, 387);
this->textBox3->Name = L" textBox3″ ;
this->textBox3->Size = System: Drawing:Size (379, 20);
this->textBox3->TabIndex = 17;
// label4.
this->label4->AutoSize = true;
this->label4->Location = System: Drawing:Point (12, 390);
this->label4->Name = L" label4″ ;
this->label4->Size = System: Drawing:Size (17, 13);
this->label4->TabIndex = 16;
this->label4->Text = L" Y:" ;
// comboBox1.
this->comboBox1->FormattingEnabled = true;
this->comboBox1->Items->AddRange (gcnew cli: array (3) { L" Sin (x)", L" Cos (x)", L" Pow (x, 2)" });
this->comboBox1->Location = System: Drawing:Point (318, 102);
this->comboBox1->Name = L" comboBox1″ ;
this->comboBox1->Size = System: Drawing:Size (101, 21);
this->comboBox1->TabIndex = 18;
this->comboBox1->SelectedIndexChanged += gcnew System: EventHandler (this, &MyForm:comboBox1_SelectedIndexChanged);
// label5.
this->label5->AutoSize = true;
this->label5->Location = System: Drawing:Point (318, 86);
this->label5->Name = L" label5″ ;
this->label5->Size = System: Drawing:Size (64, 13);
this->label5->TabIndex = 19;
this->label5->Text = L" ΠΠΎΡΡΡΠΎΠΈΡΡ:" ;
// label6.
this->label6->AutoSize = true;
this->label6->Location = System: Drawing:Point (315, 137);
this->label6->Name = L" label6″ ;
this->label6->Size = System: Drawing:Size (23, 13);
this->label6->TabIndex = 20;
this->label6->Text = L" ΠΡ:" ;
// textBox4.
this->textBox4->Location = System: Drawing:Point (344, 134);
this->textBox4->Name = L" textBox4″ ;
this->textBox4->Size = System: Drawing:Size (75, 20);
this->textBox4->TabIndex = 21;
this->textBox4->Text = L" -100″ ;
// textBox5.
this->textBox5->Location = System: Drawing:Point (344, 160);
this->textBox5->Name = L" textBox5″ ;
this->textBox5->Size = System: Drawing:Size (75, 20);
this->textBox5->TabIndex = 23;
this->textBox5->Text = L" 100″ ;
// label7.
this->label7->AutoSize = true;
this->label7->Location = System: Drawing:Point (315, 163);
this->label7->Name = L" label7″ ;
this->label7->Size = System: Drawing:Size (25, 13);
this->label7->TabIndex = 22;
this->label7->Text = L" ΠΠΎ:" ;
// textBox6.
this->textBox6->Location = System: Drawing:Point (344, 196);
this->textBox6->Name = L" textBox6″ ;
this->textBox6->Size = System: Drawing:Size (75, 20);
this->textBox6->TabIndex = 25;
this->textBox6->Text = L" 1″ ;
// label8.
this->label8->AutoSize = true;
this->label8->Location = System: Drawing:Point (315, 199);
this->label8->Name = L" label8″ ;
this->label8->Size = System: Drawing:Size (30, 13);
this->label8->TabIndex = 24;
this->label8->Text = L" Π¨Π°Π³:" ;
// MyForm.
this->AutoScaleDimensions = System: Drawing:SizeF (6, 13);
this->AutoScaleMode = System: Windows:Forms:AutoScaleMode:Font;
this->ClientSize = System: Drawing:Size (426, 419);
this->Controls->Add (this->textBox6);
this->Controls->Add (this->label8);
this->Controls->Add (this->textBox5);
this->Controls->Add (this->label7);
this->Controls->Add (this->textBox4);
this->Controls->Add (this->label6);
this->Controls->Add (this->label5);
this->Controls->Add (this->comboBox1);
this->Controls->Add (this->textBox3);
this->Controls->Add (this->label4);
this->Controls->Add (this->textBox2);
this->Controls->Add (this->label3);
this->Controls->Add (this->label2);
this->Controls->Add (this->button2);
this->Controls->Add (this->label1);
this->Controls->Add (this->textBox1);
this->Controls->Add (this->pictureBox1);
this->Controls->Add (this->button1);
this->Name = L" MyForm" ;
this->Text = L" MyForm" ;
this->FormClosing += gcnew System: Windows:Forms:FormClosingEventHandler (this, &MyForm:MyForm_FormClosing);
this->Load += gcnew System: EventHandler (this, &MyForm:MyForm_Load);
(cli:safe_cast (this->pictureBox1))->EndInit ();
this->ResumeLayout (false);
this->PerformLayout ();
}.
#pragma endregion.
void MakeFunct ().
{.
try.
{.
Points->Clear ();
for (double i = double: Parse (textBox4->Text); i Text); i += double: Parse (textBox6->Text)).
{.
try.
{.
double x = (static_cast (NCalc:Expression (textBox1->Text->Replace («x», i. ToString ())).Evaluate ()));
if (!Double:IsInfinity (x) && x > -214 748 364).
{.
Points->Add (Point ((pictureBox1->Width / 2) + i, (pictureBox1->Height / 2) — x));
textBox2->Text += ((pictureBox1->Width / 2) + i) + «,» ;
textBox3->Text += ((pictureBox1->Height / 2) — x) + «,» ;
}.
}.
catch (Exception^ ex).
{.
int x = (static_cast (NCalc:Expression (textBox1->Text->Replace («x», i. ToString ())).Evaluate ()));
if (x > -214 748 364).
{.
Points->Add (Point ((pictureBox1->Width / 2) + i, (pictureBox1->Height / 2) — x));
textBox2->Text += i + «,» ;
textBox3->Text += x + «,» ;
}.
}.
}.
pictureBox1->Invalidate ();
}.
catch (const std: exception&).
{.
}.
}.
private: System: Void button1_Click (System:Object^ sender, System: EventArgs^ e) {.
MakeFunct ();
}.
private: System: Void pictureBox1_Paint (System:Object^ sender, System: Windows:Forms:PaintEventArgs^ e) {.
Graphics^ g = e->Graphics;
g->DrawLine (Pens:Red, pictureBox1->Width / 2, 0, pictureBox1->Width / 2, pictureBox1->Height);
g->DrawLine (Pens:Red, 0, pictureBox1->Height / 2, pictureBox1->Width, pictureBox1->Height/2);
int temp = 25;
for (int i = pictureBox1->Width/2; i Width; i+=25).
{.
g->DrawString (temp.ToString (), SystemFonts: DefaultFont, Brushes: Red, i, pictureBox1->Height/2);
temp += 25;
}.
temp = -25;
for (int i = pictureBox1->Width / 2−25; i >= 0; i -= 25).
{.
g->DrawString (temp.ToString (), SystemFonts: DefaultFont, Brushes: Red, i, pictureBox1->Height / 2);
temp -= 25;
}.
temp = 25;
for (int i = pictureBox1->Height / 2−25; i >= 0; i -= 25).
{.
g->DrawString (temp.ToString (), SystemFonts: DefaultFont, Brushes: Red, pictureBox1->Width / 2, i);
temp += 25;
}.
temp = -25;
for (int i = pictureBox1->Height / 2+10; i Height; i += 25).
{.
g->DrawString (temp.ToString (), SystemFonts: DefaultFont, Brushes: Red, pictureBox1->Width / 2, i);
temp -= 25;
}.
//ΠΡΠ΅ΠΎΠ±ΡΠ°Π·ΡΠ΅ΠΌ ArrayList Π² ΠΌΠ°ΡΡΠΈΠ² ΡΠΎΡΠ΅ΠΊ.
try.
{.
if (Points->Count > 0).
{.
array^ pt = gcnew array (Points->Count);
Points->CopyTo (pt);
g->DrawLines (Pens:Black, pt);
delete pt;
}.
}.
catch (std:exception ex).
{.
}.
}.
private: System: Void MyForm_FormClosing (System:Object^ sender, System: Windows:Forms:FormClosingEventArgs^ e) {.
delete Points;
}.
private: System: Void button2_Click (System:Object^ sender, System: EventArgs^ e);
private: System: Void comboBox1_SelectedIndexChanged (System:Object^ sender, System: EventArgs^ e);
private: System: Void MyForm_Load (System:Object^ sender, System: EventArgs^ e) {.
}.
};
}.
ΠΠ ΠΠΠΠΠΠΠΠ Π.