Program.cs code:
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();
}
}
Form1 Code:
Program.form2.pictureBox1.Refresh();
Error:
Object reference not set to an instance of an object.
Not sure why there's an error, I've asked google and no help. Thanks for your help.