The.Anti.9
The.Anti.9

Reputation: 44728

How to make a text box in a command line window?

I'm working with .NET (specifically Boo, but answers would work in C# too) and I want to know how I could create an editable box inside the command line, such that I could display a section of output in the top part of the command line, and have a one line box at the bottom for input, much like the program irssi (the IRC client) does.

I assume this is possible with .NET, how would I approach this?

Upvotes: 2

Views: 1370

Answers (4)

kenny
kenny

Reputation: 22394

Another higher level option would be the mono.curses assembly.

Upvotes: 0

bo.
bo.

Reputation: 56

You can use Console.SetCursorPosition(Column, Row) to set the cursor to the appropriate position. For your example, use Console.SetCursorPosition(0, Console.WindowHeight-1) to place the cursor at the lower-most row and then let the user enter text.

Upvotes: 1

John Feminella
John Feminella

Reputation: 311645

irssi uses a library called ncurses, but in .Net, the System.Console object provides you with pretty much everything you need to make console-based applications.

Upvotes: 1

Jon Onstott
Jon Onstott

Reputation: 13727

Isn't what you need a Windows application, with command-line client hosted inside of it?

Upvotes: 1

Related Questions