From b634166051933132aba1d7e9c9d949e30614040f Mon Sep 17 00:00:00 2001 From: Laura Date: Wed, 6 Jun 2018 09:18:36 +0200 Subject: [PATCH] small fix --- ProgressBarLib/ProgressBar.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ProgressBarLib/ProgressBar.cs b/ProgressBarLib/ProgressBar.cs index 2216db8..94f653a 100644 --- a/ProgressBarLib/ProgressBar.cs +++ b/ProgressBarLib/ProgressBar.cs @@ -30,7 +30,7 @@ namespace ProgressBarLib _msgList.Clear(); } - + ClearCurrentConsoleLine(); Console.Write("\r" + _mainMsg); Thread.Sleep(500); } @@ -111,5 +111,13 @@ namespace ProgressBarLib return progStr; } + + private static void ClearCurrentConsoleLine() + { + var currentLineCursor = Console.CursorTop; + Console.SetCursorPosition(0, Console.CursorTop); + Console.Write(new string(' ', Console.WindowWidth)); + Console.SetCursorPosition(0, currentLineCursor); + } } } \ No newline at end of file