public class test{
  private string name = @"aa";
  public override string to string{
   retrun this.name;
  }
}
private testobj = new test();
this.mylistbox.items.add(testobj);
testobj.name = @"bb";
这时候在LISTBOX里还是显示aa,怎么才能显示BB啊??

解决方案 »

  1.   

    呵呵,不行的噢,不变的,不过如果你取得LISTBOX里的那个对象,他的值已经变了,但是不显示出来的
      

  2.   

    this.mylistbox.Items[0] = this.mylistbox.Items[0];
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) http://feiyun0112.cnblogs.com/
      

  3.   

            public Form1()
            {
                InitializeComponent();
                Test testobj = new Test();
                this.listBox1.Items.Add(testobj.Name.ToString());
            } 
            private void button1_Click(object sender, EventArgs e)
            {           
                this.listBox1.Items[0] =  @"bb";             
            }       
         
            public   class   Test
            { 
                private   string   name   =   @"aa";
                public string Name
                {
                    get 
                    {
                        return name;
                    }
                    set
                    {
                        name = value;
                    }
                }
                 
            }这个可以实现的功能是不是你想要的