我必须在这里制作一个简单的程序,但我不太确定如何启动它。我已经定义了我的类文件,如下所示。我需要做的是制作一个Windows Form Application(如下图所示)。我需要将信息输入到文本框中,然后将其输出到底部的richtextbox1中。而且我没有在下面显示它,但是在 Windows 窗体中,如果我在此类文件中有方法,您如何调用它?
class Telephone
{
private string manufacturer;
private string model;
private bool isConnected = false;
private string lastNumberDialed;
private string phoneNumber;
public Telephone()
{
}
public Telephone(string manufacturer, string model, string phoneNumber)
{
Manufacturer = manufacturer;
Model = model;
PhoneNumber = phoneNumber;
}
public string Manufacturer
{
get { return manufacturer; }
set { manufacturer = value; }
}
public string Model
{
get { return model; }
set { model = value; }
}
public string PhoneNumber
{
get { return phoneNumber; }
set { phoneNumber = value; }
}
new public string ToString()
{
return "Manufacturer: " + manufacturer;
}
}
这是设计代码:
public partial class TelephoneEntryForm : Form
{
public TelephoneEntryForm()
{
InitializeComponent();
}
private void btnEnter_Click(object sender, EventArgs e)
{
}
private void btnShowPhones_Click(object sender, EventArgs e)
{
}
private void btnDial_Click(object sender, EventArgs e)
{
}
private void btnRedial_Click(object sender, EventArgs e)
{
}
private void btnHangUp_Click(object sender, EventArgs e)
{
}
}