본문으로 바로가기

Thread.Sleep 시 UI 멈추는 현상 해결

category Coding/C# 2015. 11. 8. 15:28
반응형

private static DateTime Delay(int MS)

{

DateTime ThisMoment = DateTime.Now;

TimeSpan duration = new TimeSpan(0, 0, 0, 0, MS);

DateTime AfterWards = ThisMoment.Add(duration);

while (AfterWards >= ThisMoment)

{

System.Windows.Forms.Application.DoEvents();

ThisMoment = DateTime.Now;

}

return DateTime.Now;

}


위 함수로 대신사용




출처 : http://bananamandoo.tistory.com/27

반응형

'Coding > C#' 카테고리의 다른 글

Thread 인자넘겨주기  (0) 2015.11.09
디시인사이드 자동댓글소스  (0) 2015.11.08
글 파싱  (0) 2015.11.08
디시인사이드 댓글  (0) 2015.11.08
C# Webbrowser.navigate 다중행  (0) 2015.11.06