I bob. Nazariy qism zamonaviy dasturlash tillari


Download 1.1 Mb.
bet20/20
Sana08.01.2022
Hajmi1.1 Mb.
#244731
1   ...   12   13   14   15   16   17   18   19   20
Bog'liq
Dasturlash namuna

Button2Click(object sender, EventArgs e)
        {
            Graphics g;
            g=pictureBox1.CreateGraphics();
            g.Clear(Color.White);
        }
        void Button1Click(object sender, EventArgs e)
        {
            float x1 ,y1,x2,y2,x3,y3,x4,y4;
            float x_0, y_0, x_end,y_end;x_0=20; y_0=20;
            x1 = Convert.ToSingle(textBox1.Text)+x_0;
            y1 = -Convert.ToSingle(textBox2.Text)+pictureBox1.Height-y_0;
            x2=Convert.ToSingle(textBox3.Text)+x_0;
            y2=-Convert.ToSingle(textBox4.Text)+pictureBox1.Height-y_0;
            x3= Convert.ToSingle(textBox5.Text)+x_0;
            y3= -Convert.ToSingle(textBox6.Text)+pictureBox1.Height-y_0;
            x4=Convert.ToSingle(textBox7.Text)+x_0;
            y4=-Convert.ToSingle(textBox8.Text)+pictureBox1.Height-y_0;
            Graphics g;
            g= pictureBox1.CreateGraphics();
            Pen myPenAxes=new Pen(Color.Black, 1);
            x_end=pictureBox1.Width-y_0;
            g.DrawLine(myPenAxes,x_0,pictureBox1.Height-y_0,x_end, pictureBox1.Height-y_0);
            y_end=y_0;
            g.DrawLine(myPenAxes,x_0,pictureBox1.Height-y_0,x_0,y_0);
            Pen mypen = new Pen(Color.Black,3);
            g.DrawLine(mypen,x1,y1,x2,y2);
            g.DrawLine(mypen,x2,y2,x3,y3);
            g.DrawLine(mypen,x3,y3,x4,y4);
                
        }
        void TextBox1TextChanged(object sender, EventArgs e)
        {
    
        }
    }
}



Download 1.1 Mb.

Do'stlaringiz bilan baham:
1   ...   12   13   14   15   16   17   18   19   20




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling