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

解决方案 »

  1.   

    Form1.Designer.cs可能和From1.cs不一致,看一下名称或者类的名称是不是不一致.
      

  2.   

    确认 Form1.Designer.cs 的namespace lab02  !
      

  3.   

    确认 Form1.Designer.cs 的namespace lab02  !!!!这个你看一下 不就知道了
      

  4.   

    查看你的public partial class Form1 : Form 
    和Form.Design.cs的命名空间以及类名是否一致
      

  5.   

    就是说Form1.Designer.cs的namespace和现在你给我们看的这段代码的namespace不一致!