#pragma endregion
private: Graphics^ m_panel1;
private: Graphics^ m_panel2;
private: Graphics^ m_panel3;
private: System::Drawing::Color Color1;
private: System::Drawing::Color Color2;
private: System::Drawing::Color Color3;
private: Pen^ Pen1;
private: Pen^ Pen2;
private: Pen^ Pen3;
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
Close();
}
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
m_panel1=panel1->CreateGraphics();
m_panel2=panel2->CreateGraphics();
m_panel3=panel3->CreateGraphics();
Color1=System::Drawing::Color::Blue;
Color2=System::Drawing::Color::Red;
Color3=System::Drawing::Color::Green;
Pen1=gcnew Pen(Color1);
Pen2=gcnew Pen(Color2);
Pen3=gcnew Pen(Color3);
System::Int32 Width;
System::Int32 Height;
Width=panel1->Width;
Height=panel1->Height;
System::Int32 centr_X;
System::Int32 centr_Y;
centr_X=Width/2;
centr_Y=Height/2;
m_panel1->DrawLine(Pen1,0,centr_Y,Width,centr_Y);
m_panel2->DrawLine(Pen2,0,centr_Y,Width,centr_Y);
m_panel3->DrawLine(Pen3,0,centr_Y,Width,centr_Y);
m_panel1->DrawLine(Pen1,centr_X,0,centr_X,Height);
m_panel2->DrawLine(Pen2,centr_X,0,centr_X,Height);
m_panel3->DrawLine(Pen3,centr_X,0,centr_X,Height);
m_panel1->DrawLine(Pen1,0,0,Width,Height);
m_panel2->DrawLine(Pen2,0,0,Width,Height);
m_panel3->DrawLine(Pen3,0,0,Width,Height);
m_panel1->DrawLine(Pen1,0,Height,Width,0);
m_panel2->DrawLine(Pen2,0,Height,Width,0);
m_panel3->DrawLine(Pen3,0,Height,Width,0);
m_panel1->DrawRectangle(Pen1,centr_X-50,centr_Y-50,100,100);
m_panel2->DrawRectangle(Pen2,centr_X-50,centr_Y-50,100,100);
m_panel3->DrawRectangle(Pen3,centr_X-50,centr_Y-50,100,100);
m_panel1->DrawEllipse(Pen1,centr_X-40,centr_Y-40,80,80);
m_panel2->DrawEllipse(Pen2,centr_X-40,centr_Y-40,80,80);
m_panel3->DrawEllipse(Pen3,centr_X-40,centr_Y-40,80,80);
}
};
}
Brak komentarzy:
Prześlij komentarz