using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace Test
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static Form1 f;
public static Form2 f2;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
f = new Form1();
f2 = new Form2();
}
}
}
private void button1_Click(object sender, EventArgs e)
{
Program.f2.Show();
this.Hide(); }
该按钮给出“对象引用未设置为对象的实例”。错误。我该如何解决?我的代码中没有任何错误。