1

Currently when I use the scrollbar on my c# console app, it seems to halt/interrupt the application until I "let go" of the scrollbar.

Is there a way to keep this from happening?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Taurian
  • 1,660
  • 7
  • 20
  • 28
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Jan 30 '13 at 17:38
  • You'll need to reason what would happen if it didn't do this. How would a user look at prior output when the program is rapidly adding new lines? Feature, not a bug. Try typing Ctrl+S btw. – Hans Passant Jan 30 '13 at 18:21

2 Answers2

1

Here's an old post I'm just quoting from, which explains the Pause when using the scrollbar in cmd prompt :

"Technically, only displaying output is suspended while you hold the scrollbar: the console subsystem temporarily stops reading from the output buffer and displaying it. However, the process remains running, and said output buffer fills up very quickly, which makes all further write()'s "block" for as long as the buffer is full. This is what makes the process appear to pause.

(Note that there are two distinct components – the console window and the programs running inside. The "Command Prompt" is only the cmd.exe command interpreter, but the window along with scrollbars is displayed by CSRSS."

Here's the link to the post : https://superuser.com/questions/344262/windows-command-prompt-pause-during-mousedown

Community
  • 1
  • 1
0

You will need to run your long-running code in another thread, then writing to the console when need be - see this post: Using .NET BackgroundWorker class in console app

Community
  • 1
  • 1
Dave Bish
  • 19,263
  • 7
  • 46
  • 63