Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# is there a way to set the scroll position of a console application

Tags:

c#

scroll

console

Hi I have been Googling this question for quite a while and cant find any results on how I would go about doing this. I currently have a selection menu that the user can select a list of options from and this starts at the top but the window displays the last options each time I refresh the list. All I want to do is be able to display the line with the selected option on in the window.

any ideas will be appreciated.

like image 834
bobthemac Avatar asked Jan 04 '12 15:01

bobthemac


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

What is C in C language?

What is C? C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.

Is C language easy?

C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.


2 Answers

Console.SetCursorPosition(XCoordinate,YCoordinate);

Should do the trick.

like image 175
Icarus Avatar answered Oct 15 '22 04:10

Icarus


This is what I used in the end and it worked as I wanted it to.

Console.SetWindowPosition(0 , currentItem);
like image 31
bobthemac Avatar answered Oct 15 '22 05:10

bobthemac