程序是这样写的:
ListBoxItem newItem = new ListBoxItem();
newItem.Content = news[i];
newItem.Tag = newItems[i];
this.listBox1.Items.Add(newItem);     显示:
 MessageBox.Show(listBox1.Items[listBox1.SelectedIndex].ToString());                                      

解决方案 »

  1.   

    class ListBoxItem
        {
            public string Content
            {
                get;
                set;
            }
            public string  Tag { get; set; }        public override string ToString()
            {
                return this.Tag;
            }
        }
    上面是看你的代码猜的..只要在ListBoxItem类里面重写 ToString()方法就行
      

  2.   

    如果你要显示Content内容:MessageBox.Show(((ListBoxItem)(listBox1.Items[listBox1.SelectedIndex])).Content);
      

  3.   


    或者:
    MessageBox.Show(((ListBoxItem)(listBox1.SelectedItem)).Content);
      

  4.   

    可是他在listbox里的显示的还是带有那些英文啊,那个怎么去掉
      

  5.   

    在ListBoxItem里重写ToString()
       public override string ToString()
       {
       return this.Tag;//要显示Content的话就是  return this.Content;
       }
     
    ok?
      

  6.   

    通常像listBox这样的控件添加行的时候都是用绑定数据源的方式比如:
    //绑定数据
     List<string> st = new List<string>();
     st.Add("conteng1");
     st.Add("conteng2");
     listBox1.ItemsSource = st;//触发事件  
    string a = listBox1.Items[listBox1.SelectedIndex].ToString();
    MessageBox.Show(a); 这样就可以显示你想要的结果了
      

  7.   

    MessageBox.Show(listBox1.Items[listBox1.SelectedIndex].Content .ToString());