#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Graphics^ g=panel1->CreateGraphics();
Pen^ pen1=gcnew Pen(System::Drawing::Color::Brown);
Pen^ pen2=gcnew Pen(System::Drawing::Color::Green);
Pen^ pen3=gcnew Pen(System::Drawing::Color::Blue);
Pen^ pen4=gcnew Pen(System::Drawing::Color::Black);
pen1->Width=3;
pen2->Width=3;
pen3->Width=3;
pen4->Width=4;
pen4->DashStyle=System::Drawing::Drawing2D::DashStyle::Dot;
int width,height,centr_x,centr_y,down_margin,down_margin2,line1=400,A,B,C,D,A1,B1,C1,D1;
width=panel1->Width;
height=panel1->Height;
down_margin=height-5;
centr_x=width/2;
centr_y=height/2;
A=centr_x-(line1/2);
B=centr_x+(line1/2);
g->DrawLine(pen1,A,down_margin,B,down_margin);
C=A+150;
D=B+150;
down_margin2=down_margin-150;
g->DrawLine(pen1,C,down_margin2,D,down_margin2);
g->DrawLine(pen1,A,down_margin,C,down_margin2);
g->DrawLine(pen1,B,down_margin,D,down_margin2);
g->DrawLine(pen4,A,down_margin,D,down_margin2);
A1=down_margin-400;
B1=down_margin-400;
C1=down_margin2-400;
D1=down_margin2-400;
g->DrawLine(pen2,A,down_margin,A,A1);
g->DrawLine(pen2,B,down_margin,B,B1);
g->DrawLine(pen2,C,down_margin2,C,C1);
g->DrawLine(pen2,D,down_margin2,D,D1);
g->DrawLine(pen4,D,down_margin2,C,C1);
g->DrawLine(pen4,C,C1,A,down_margin);
g->DrawLine(pen3,A,A1,B,B1);
g->DrawLine(pen3,C,C1,D,D1);
g->DrawLine(pen3,A,A1,C,C1);
g->DrawLine(pen3,B,B1,D,D1);
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
Close();
}
};
}
Brak komentarzy:
Prześlij komentarz