我想单击按钮时更改窗体的背景图像。我被困在这个错误。它说:通过按钮单击更改窗体背景图像
一个对象引用需要 非静态字段,方法或 属性 'System.Windows.Forms.Control.BackgroundImage.get'
private void pictureBox1_MouseHover(object sender, EventArgs e)
{
pictureBox1.Location = new Point(25, 9);
}
private void pictureBox1_MouseLeave(object sender, EventArgs e)
{
pictureBox1.Location = new Point(18, 9);
}
private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
{
Form1.BackgroundImage =
}
在代码的最后部分,您可以看到我正在尝试更改表单的背景图像。但它不允许我,我不知道如何正确地做到这一点。
谢谢,解决了它.. – 2011-06-05 03:19:16
不客气。 – 2011-06-05 07:11:19