是新來的C#,我需要你的幫助,在此,我想在一個文本框,這一次顯示一個字符是我的代碼C#.NET打印字符串的一個字符時在TextBox
private void timer1_Tick(object sender, EventArgs e)
{
int i = 0; //why does this don't increment when it ticks again?
string str = "Herman Lukindo";
textBox1.Text += str[i];
i++;
}
private void button1_Click(object sender, EventArgs e)
{
if(timer1.Enabled == false)
{
timer1.Enabled = true;
button1.Text = "Stop";
}
else if(timer1 .Enabled == true)
{
timer1.Enabled = false;
button1.Text = "Start";
}
}
你設置我在每次計時器滴答時間爲零。 –
誰降低了這個?這是第一次發佈 – musefan
'if if(timer1.Enabled){} else {}'...好得多(帶有換行符) – musefan