, Visual C#


- 2


myColor = true;

}

else

{

// pictureBox1:

this.pictureBox1.BackColor = Color.Yellow;

// myColor :

myColor = false;

}

}

77.4. .

 

// DrawImage ,

// pictureBox1:

e.Graphics.DrawImage(pictureBox1.Image, 0, 0);

 

// DrawString

// : d, H, Rn, s, rho:

string msg;

msg = "d = " + textBox1.Text + " mm";

e.Graphics.DrawString(msg, this.Font, Brushes.Black, 400, 100);

msg = "H = " + textBox2.Text + " mm";

e.Graphics.DrawString(msg, this.Font, Brushes.Black, 400, 120);

msg = "Rn = " + textBox3.Text + " mm";

e.Graphics.DrawString(msg, this.Font, Brushes.Black, 400, 140);

msg = "s = " + textBox4.Text + " mm";

e.Graphics.DrawString(msg, this.Font, Brushes.Black, 400, 160);

msg = "rho = " + textBox5.Text + " kg/(m*m*m*)";

e.Graphics.DrawString(msg, this.Font, Brushes.Black, 400, 180);

 

// DrawString

// : A, V, m, D:

msg = "A = " + textBox6.Text + " mm*mm";

e.Graphics.DrawString(msg, this.Font, Brushes.Black, 400, 220);

msg = "V = " + textBox7.Text + " mm*mm*mm";

e.Graphics.DrawString(msg, this.Font, Brushes.Black, 400, 240);

msg = "m = " + textBox8.Text + " kg";

e.Graphics.DrawString(msg, this.Font, Brushes.Black, 400, 260);

msg = "D = " + textBox9.Text + " mm";

e.Graphics.DrawString(msg, this.Font, Brushes.Black, 400, 280);