|
分類:[C#]
分類:[C#]
初めまして。近頃C#をはじめたのですが、下記のように同じ処理を何度もやる状態になってしまって、困っています。
CLASS等で行けるのかなとは思うのですが、どうにもさっぱりなので、よろしければ教えてもらえないでしょうか。
private void pictureBox3_Click_1(object sender, EventArgs e) { pictureBox1.Image = null; pictureBox1.Hide(); pictureBox2.Image = null; pictureBox2.Hide(); pictureBox3.Image = null; pictureBox3.Hide(); pictureBox4.Image = null; pictureBox4.Hide(); pictureBox5.Image = null; pictureBox5.Hide(); pictureBox6.Image = null; pictureBox6.Hide(); pictureBox8.Show(); Bitmap bit_map7 = new Bitmap(GetType(), "BLACK2.png"); Bitmap bit_map8 = new Bitmap(GetType(), "WCP3.png"); pictureBox7.Image = bit_map7; pictureBox8.Image = bit_map8; button3.Show(); button2.Show(); button1.Show(); }
private void pictureBox4_Click(object sender, EventArgs e) { pictureBox1.Image = null; pictureBox1.Hide(); pictureBox2.Image = null; pictureBox2.Hide(); pictureBox3.Image = null; pictureBox3.Hide(); pictureBox4.Image = null; pictureBox4.Hide(); pictureBox5.Image = null; pictureBox5.Hide(); pictureBox6.Image = null; pictureBox6.Hide(); pictureBox8.Show(); Bitmap bit_map7 = new Bitmap(GetType(), "BLACK2.png"); Bitmap bit_map8 = new Bitmap(GetType(), "WCP4.png"); pictureBox7.Image = bit_map7; pictureBox8.Image = bit_map8; button3.Show(); button2.Show(); button1.Show(); }
………
|