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 Form5 : Form
{
private Pickups thePickups;
//The pickups object being created/edited
public Pickups appointment
{ //Property to allow access to thePickups
get { return thePickups; }
set { thePickups = value; }
}
public Form5()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
thePickups.custName = textBox1.Text;
thePickups.custAddress= textBox2.Text;
thePickups.arrival = textBox3.Text;
thePickups.delAddress = textBox4.Text;
thePickups.delName = textBox5.Text;
this.Hide();
//Hide the form
}
private void Form5_Load(object sender, EventArgs e)
{
if (thePickups != null)
{
textBox1.Text = thePickups.custName;
textBox2.Text = thePickups.delAddress.ToString();
textBox3.Text = thePickups.arrival.ToString();
}
}
}
}
我收到一条错误消息 - 对象引用未设置为对象的实例,这是我项目中的许多文件之一,但它是我遇到任何错误的第一个文件。我很难看到我在这里犯了错误,任何帮助将不胜感激。