private void pictureBox1_Click(object sender, EventArgs e) { //MessageBox.Show((sender as PictureBox).Size.Height.ToString()); //MessageBox.Show((sender as PictureBox).Size.Width.ToString()); (sender as PictureBox).Height = 230; (sender as PictureBox).Width = 230; (sender as PictureBox).BringToFront(); MessageBox.Show((sender as PictureBox).Name); }
(sender as PictureBox).BringToFront(); 可以把当前选中的控件置于顶层