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中显示这个文本呢?
{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中显示这个文本呢?
{
//获得响应字符串
string result = "长文本"
Forms Re = new Forms();
Re.ResultLiB.Items.( result );
}
{
//获得响应字符串
string result = "长文本"
Forms Re = new Forms();
Re.ResultLiB.Items.Add( result );
}