我想做的操作是这样的我用鼠标单击一下listbox里面的其中一个item然后返回item里面的字段我现在就是不知道应该用listbox的哪一个事件?谢谢各位的帮忙

解决方案 »

  1.   

    listbox的SelectedIndexChanged事件
    在该事件中:
    listbox1.selectedItem.Text //取LISTBOX中的当前选择项的列表内容
    ListBox1.SelectedItem.Value //取LISTBOX中当前选择项所对应的VALUE的值protected   void   ListBox1_SelectedIndexChanged(object   sender,   EventArgs   e)   
              {   
                      if(ListBox1.SelectedIndex   ==   -1)   
                      {   
                              return;   
                      }   
                        
                      this.TextBox1.Text   =   ListBox1.SelectedItem.Text;   
                      this.TextBox2.Text   =   ListBox1.SelectedItem.Value;   
              }