Console line
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts
Page 1 of 1
Can I bind first line of console to specific text and change it in future?
Like in Counter Strike 1.6 console server - first line will display only server stats, whyle other lines working as console lines( :lol: )
Like this:

First line is my goal.
Like in Counter Strike 1.6 console server - first line will display only server stats, whyle other lines working as console lines( :lol: )
Like this:

First line is my goal.
You can get the current console cursor position with Console.CursorLeft and Console.CursorTop.
You can use this to move the cursor to the top left:
You can use this to move the cursor to the top left:
Code: Select all
When you have finished writing to the top line you can also put the cursor back to where it was.Console.SetCursorPosition(0, 0)
So the whole code would be:
Code: Select all
Private Sub WriteSomethingInRedAtTheTop(ByVal s As String)
Dim cursorLeft As Integer = Console.CursorLeft
Dim cursorTop As Integer = Console.CursorTop
Dim color As ConsoleColor = Console.ForegroundColor
Console.SetCursorPosition(0, 0)
Console.ForegroundColor = ConsoleColor.Red
Console.Write(s)
Console.ForegroundColor = color
Console.SetCursorPoistion(cursorLeft, cursorTop)
End Sub
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023