这是一个一般性的问题,您应该在互联网上查找它,不要在这里问它.. btt:
Size size = new Size(100,100);
pictureBox1.Size = size;
http://msdn.microsoft.com/de-de/library/system.windows.forms.picturebox.aspxh
http://msdn.microsoft.com/de-de/library/system.windows.forms.control.size.aspx
在您的情况下,这将是您的代码:
Size size = pictureBox1.Size;
size.Height--;
size.Width--;
pictureBox1.Size = size;
要不就:
pictureBox1.Height--;
pictureBox1.Width--;
或酷的:
private int size = 50;
private void button5_Click(object sender, EventArgs e)
{
size--;
pictureBox1.Height = pictureBox1.Width = size;
}
回复:
private void button5_Click(object sender, EventArgs e)
{
pictureBox1.Height = pictureBox1.Width = pictureBox1.Width - 1;
}