Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to write text in specific position in c#

void WriteAt(int x, int y, string MessageText)
{
	int OldCursorX = System.Console.CursorLeft;
    int OldCursorY = System.Console.CursorTop;
    System.Console.SetCursorPosition(x, y);
    System.Console.Write(MessageText);
    System.Console.SetCursorPosition(OldCursorX, OldCursorY);
}

/*
WriteAt function is works like that example:
*/
WriteAt(10, 20, "HeLLo WoRlD!!");
/*
This is will send a message in the left-position:10 and the top-position:20 and the text is: "HeLLo WoRlD!!".
*/
 
PREVIOUS NEXT
Tagged: #write #text #specific #position
ADD COMMENT
Topic
Name
3+4 =