Program.cs 代码:
namespace _1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
///
public static Form2 form2;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
form2 = new Form2();
}
}
表格 1 代码:
Program.form2.pictureBox1.Refresh();
错误:
Object reference not set to an instance of an object.
不知道为什么会出现错误,我已经问过谷歌,但没有任何帮助。谢谢你的帮助。