listbox中增加或删除一个item能触发什么事件啊
希望当listbox中item改变时获得一个事件

解决方案 »

  1.   

    新增和删除这两个操作本身就是你自己程序完成的,至于要想触发什么事件,你在完成操作之后,直接调用即可。而listbox本身不支持新增和删除触发事件。
      

  2.   

    private void button1_Click(object sender, System.EventArgs e)
    {
    this.listBox1.Items.Add("12");
    } private void listBox1_CursorChanged(object sender, System.EventArgs e)
    {
    MessageBox.Show(this.listBox1.SelectedIndex.ToString());
    } private void button2_Click(object sender, System.EventArgs e)
    {

    int t=this.listBox1.SelectedIndex;
    this.listBox1.Items.Remove(this.listBox1.Items[t]);
    }楼主是这个意思吗???
      

  3.   

    to新增和删除这两个操作本身就是你自己程序完成的,至于要想触发什么事件,你在完成操作之后,直接调用即可。而listbox本身不支持新增和删除触发事件。恩,后来我想明白了,就是这么做的