你最好的選擇是初始化標籤爲隱時現的形式加載,那麼當窗體SHOWN那麼您需要運行代碼...
編輯:我意識到,OP要連續顯示標籤,而不是延遲後一下子...
public int i = 1; // public variable as a counter
private void Form1_Load(object sender, EventArgs e)
{
label1.Visible = false; // start the labels as not visible.
label2.Visible = false;
}
private void Form1_Shown(object sender, EventArgs e)
{
timer1.Start(); // start up the timer.
}
private void timer1_Tick(object sender, EventArgs e)
{
// initialize a timer that iterates through the labels provided
// and set them to visible.
while(i <= 2)
{
Label test = (Label)this.Controls["label" + i.ToString()];
test.Visible = true;
i++;
break;
}
}
移動一切都在Form_Shown事件。在Form_Load中,您的表單不可見。 – Steve
你如何創建這兩個標籤? – Steve