Results 1 to 2 of 2

Thread: [RESOLVED] Clearing part of a console

  1. #1

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,388

    Resolved [RESOLVED] Clearing part of a console

    How can I clear part of a consoles output??

    E.g if I have this:
    VB.Net Code:
    1. Console.WriteLine("The quick brown fox jumped over the lazy dog" & vbCrLf & "The quick brown fox jumped over the lazy dog")
    2. Console.CursorTop = 0
    3. Dim ClearText = "a" & vbCrLf & "b"
    4. Console.WriteLine(ClearText)

    The a and b will only replace the first 2 letters of each line; not clear the lines...

    I considered replacing them with spaces, but when this happens, after making the window narrower, it pushes the b in:
    VB.Net Code:
    1. Console.WriteLine("The quick brown fox jumped over the lazy dog" & vbCrLf & "The quick brown fox jumped over the lazy dog")
    2. Console.CursorTop = 0
    3. Dim ClearText = "a" & New String(" "c, Console.BufferWidth - 1) & "b" & New String(" "c, Console.BufferWidth - 1)
    4. Console.WriteLine(ClearText)

    Is there anyway just to clear part of the console?

    Thanks

  2. #2

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,388

    Re: Clearing part of a console

    Ok ... worked it out .. need to use:
    Fill this way with Chr(32) via API:
    VB.Net Code:
    1. FillConsoleOutputCharacter(OutputHandle, Chr(32), 1, cord, CellsWritten)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width