public class Forms : Form
    {private ListBox ResultLiB;
        private Button SubmBT;
        private Label WebsiteLB;
        public Forms()
        {
            
            //
            //添加ListBox
            //
            ListBox ResultLiB = new ListBox();
            ResultLiB.Top = 15;
            ResultLiB.Width = 350;
            ResultLiB.Height = 400;
            ResultLiB.Left = labLeft + 150 + 80;            //
            //添加Button
            //
            Button SubmBT = new Button();
            SubmBT.Top = 110;
            SubmBT.Width = 50;
            SubmBT.Height = 20;
            SubmBT.Left = labLeft+50;
            SubmBT.Text = "提 交";
            SubmBT.Click += new EventHandler(ButtonClicked);          
            this.Controls.Add(ResultLiB);          
            this.Controls.Add(SubmBT);        }
        private void ButtonClicked(object source, EventArgs e)
        {
            //获得响应字符串  
            string result = "长文本"
            Forms Re = new Forms();
            Re.ResultLiB.Items.AddRange(new object[] { result.ToString() });            //WebsiteLB.Text = result.ToString();
            rp.Close();
        }    }如何把长文本在Listbox中显示这个文本呢?

解决方案 »

  1.   

    private void ButtonClicked(object source, EventArgs e) 
            { 
                //获得响应字符串  
                string result = "长文本" 
                Forms Re = new Forms(); 
                Re.ResultLiB.Items.( result );            
            } 
      

  2.   

    CSDN不能编辑自己发完的回复?private void ButtonClicked(object source, EventArgs e) 
            { 
                //获得响应字符串  
                string result = "长文本" 
                Forms Re = new Forms(); 
                Re.ResultLiB.Items.Add( result );            
            } 
      

  3.   

    贴了一堆没用【C#code】排好的代码,最后还来了个病句哥们问题就要问得认真点
      

  4.   

    我是初学只有这水平~我问题的意思是用ListBox显示指定的一串字符,还有你指的所谓的“认真”我就无法理解了