타이머가 완료 될 때까지 다음 행을 기다려야합니다.타이머가 끝날 때까지 기다리는 방법
public void animation(){
timer1.start();
labelStatus.Visibility=true;
}
timer1이 완료된 후에 labelStatus를 표시하려고합니다.
private void timer1_Tick(object sender, EventArgs e)
{
int fromX = lblMove.Location.X;
int fromY = lblMove.Location.Y;
if (fromY > moveToY)
{
Y = Y - 5;
lblMove.Location = new Point(fromX, Y);
}
else if (fromY < moveToY)
{
Y = Y + 5;
lblMove.Location = new Point(fromX, Y);
}
else
{
timer1.Stop();
}
}
미리 감사드립니다. 내가 생각할 수있는
put labelStatus.Visibility = true; else 문에서 –
'fromY == moveToY'를 기다리고있는 것처럼 보입니다.하지만 항상 5 픽셀 씩 움직이면 반드시 그럴 필요는 없습니다! 당신이 의미하는 바를 잘 모름 _ 나는 어쨌든 그것을 숨기지 않으므로 labelStatus를 보여주고 싶습니다. 또한 : 타이머는 '마침'하지 않습니다. – TaW