using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace lab02
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} class Contact
{
public string m_name;
public string m_telephone;
public Contact()
{
this.m_name = string.Empty;
this.m_telephone = string.Empty;
}
} private Contact[] ContactArray; private void btnrun_Click(object sender, EventArgs e)
{
this.ContactArray = new Contact[3];
this.ContactArray[0] = new Contact();
this.ContactArray[1] = new Contact();
this.ContactArray[2] = new Contact(); this.ContactArray[0].m_name = "赵丽";
this.ContactArray[0].m_telephone = "010-1234567"; this.ContactArray[1].m_name = "王强";
this.ContactArray[1].m_telephone = "010-4321000"; this.ContactArray[2] = this.ContactArray[0];
this.ContactArray[2].m_telephone = "021-8234567"; foreach (Contact c in this.ContactArray)
{
this.listBox1.Items.Add("Name:" + c.m_name + ";Telephone:" + c.m_telephone + "\r\n");
} } private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}错误 1 “WindowsApplication2.Form1.Dispose(bool)”: 没有找到适合的方法来重写 D:\Documents and Settings\Administrator.ADM-76DC1F043A0\My Documents\Visual Studio 2005\Projects\WindowsApplication2\WindowsApplication2\Form1.Designer.cs 14 33 WindowsApplication2
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace lab02
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} class Contact
{
public string m_name;
public string m_telephone;
public Contact()
{
this.m_name = string.Empty;
this.m_telephone = string.Empty;
}
} private Contact[] ContactArray; private void btnrun_Click(object sender, EventArgs e)
{
this.ContactArray = new Contact[3];
this.ContactArray[0] = new Contact();
this.ContactArray[1] = new Contact();
this.ContactArray[2] = new Contact(); this.ContactArray[0].m_name = "赵丽";
this.ContactArray[0].m_telephone = "010-1234567"; this.ContactArray[1].m_name = "王强";
this.ContactArray[1].m_telephone = "010-4321000"; this.ContactArray[2] = this.ContactArray[0];
this.ContactArray[2].m_telephone = "021-8234567"; foreach (Contact c in this.ContactArray)
{
this.listBox1.Items.Add("Name:" + c.m_name + ";Telephone:" + c.m_telephone + "\r\n");
} } private void button2_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}错误 1 “WindowsApplication2.Form1.Dispose(bool)”: 没有找到适合的方法来重写 D:\Documents and Settings\Administrator.ADM-76DC1F043A0\My Documents\Visual Studio 2005\Projects\WindowsApplication2\WindowsApplication2\Form1.Designer.cs 14 33 WindowsApplication2
和Form.Design.cs的命名空间以及类名是否一致