110,537
社区成员
发帖
与我相关
我的任务
分享
public partial class Form1 : Form
{
string[] arrName = new string[7]{"aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg"};
public Form1()
{
InitializeComponent();
textBox1.Text = "";//多行
}
private void button1_Click(object sender, EventArgs e)
{
//每隔一秒textBox1增加一行(各行为数组的各元素)
//textBox1上当前行显示最后追加的一行。
}
private void button2_Click(object sender, EventArgs e)
{
//停止增加
}
}
Timer timer = new Timer();
timer1.Interval = 1000;
private void button1_Click(object sender, EventArgs e)
{
//每隔一秒textBox1增加一行(各行为数组的各元素)
timer.Start();
//textBox1上当前行显示最后追加的一行。
textBox1.AppendText(".........")
textBox1.AppendText("\r\n");
}
private void button2_Click(object sender, EventArgs e)
{
//停止增加
timer1.Stop();
}