using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public windows1 w1;
public windows2 w2;
private void Form1_Load(object sender, EventArgs e)
{
w1 = new windows1();
w2 = new windows2();
}
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
w1.Show();
gpbWindows.Controls.Clear();
gpbWindows.Controls.Add(w1);
}
private void button2_Click(object sender, EventArgs e)
{
w2.Show();
gpbWindows.Controls.Clear();
gpbWindows.Controls.Add(w2);
}
private void button4_Click(object sender, EventArgs e)
{
}
}
}
请问是那行代码报“”未将对象引用设置到对象的实例“”?