我正在尝试将项目移动到列表框,但它将我的列表框称为方法组。该程序有多个类。这是我目前所拥有的...
private void Button1_Click(object sender, EventArgs e)
{
ListBox1.Items.Add("Full Name\tAddress\tPhone Number");
Person Customer = new Person();
Customer.FirstName = NameTextBox.Text;
Customer.LastName = NameTextBox2.Text;
Customer.Address = AddressTextBox.Text + AddressTextBox2.Text + AddressTextBox3.Text;
Customer.PhoneNumber = PhoneNumberMaskedTextBox.Text;
Listbox1.Items.Add = (Customer.FirstName + Customer.LastName + "/t" + Customer.Address + "/t" + Customer.PhoneNumber);
}
人是另一个类。这是代码...
class Person
{
string _FirstName;
string _LastName;
string _Address;
string _PhoneNumber;
//Constructor
public void CustomerInfo()
{
_FirstName = "";
_LastName = "";
_Address = "";
_PhoneNumber = "";
}
public string FirstName
{
get { return _FirstName; }
set { _FirstName = value; }
}
public string LastName
{
get { return _LastName; }
set { _LastName = value; }
}
public string Address
{
get { return _Address; }
set { _Address = value; }
}
public string PhoneNumber
{
get { return _PhoneNumber; }
set { _PhoneNumber = value; }
}
}