Clearing the Console
-
I can't believe I haven't been able to find any way to clear the console screen in vb.net. All I want is to clear the console screen just like issuing a cls command at a command prompt. Does anyone out there know how this is done?
-
I can't believe I haven't been able to find any way to clear the console screen in vb.net. All I want is to clear the console screen just like issuing a cls command at a command prompt. Does anyone out there know how this is done?
You could try P/Invoke'ing the
FillConsoleOutputCharacter
function. See MSDN Library for details. -
You could try P/Invoke'ing the
FillConsoleOutputCharacter
function. See MSDN Library for details.Thank you! I found it in the MSDN libraries url is http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B319239 if anyone is interested. A WHOLE lot of work just to clear the console, I can't believe they didn't include this functionality in the Console namespace. Oh well, maybe next time. Thanks again!
-
Thank you! I found it in the MSDN libraries url is http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B319239 if anyone is interested. A WHOLE lot of work just to clear the console, I can't believe they didn't include this functionality in the Console namespace. Oh well, maybe next time. Thanks again!
-
I can't believe I haven't been able to find any way to clear the console screen in vb.net. All I want is to clear the console screen just like issuing a cls command at a command prompt. Does anyone out there know how this is done?
Have a look at Tim Sneath's sample on GotDotNet for some of the missing console functions: http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=b76d1f08-2d79-47bd-825b-0489938aae0f[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer