473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Creating a 'console application'

C# novice...

Can I create a console application (think the Pine email reader or even
'edit' in DOS) where I can use my up/down/side arrows to move around the
app?

I'd want something with a simple menu system as well as popup functionality.

Any hints/pointers to get me started?

Marco
Dec 29 '06 #1
3 7247
Hi,

I know of nothing like that, at least for .net

why would you like something like that?

"Marco Shaw" <marcoDOTshaw_@_gmailDOTcomwrote in message
news:%2*****************@TK2MSFTNGP06.phx.gbl...
C# novice...

Can I create a console application (think the Pine email reader or even
'edit' in DOS) where I can use my up/down/side arrows to move around the
app?

I'd want something with a simple menu system as well as popup
functionality.

Any hints/pointers to get me started?

Marco

Dec 29 '06 #2
He Marco... The answer is "of course." :-) I hate to sound like an old dude
but frankly that's how we used to write apps. I wrote DOS apps (probably
some still in use) by writing the library code for the form, menu, buttons
and other controls first. The user could drag "windows" around the DOS
screen, control background colors, play sounds and all that good stuff.

In the extreme form the fanciest UI's were called "games." :-) Consider if
they could write DOOM without the Windows GUI you must be able to generate a
text-based menu system. As you point out, EDIT still works, if it wasn't
possible then it shouldn't work.
"Marco Shaw" <marcoDOTshaw_@_gmailDOTcomwrote in message
news:%2*****************@TK2MSFTNGP06.phx.gbl...
C# novice...

Can I create a console application (think the Pine email reader or even
'edit' in DOS) where I can use my up/down/side arrows to move around the
app?

I'd want something with a simple menu system as well as popup
functionality.

Any hints/pointers to get me started?

Marco

Dec 30 '06 #3
On Fri, 29 Dec 2006 15:29:24 -0400, "Marco Shaw"
<marcoDOTshaw_@_gmailDOTcomwrote:
>C# novice...

Can I create a console application (think the Pine email reader or even
'edit' in DOS) where I can use my up/down/side arrows to move around the
app?
Yes.
>Any hints/pointers to get me started?

Marco
Use elements of Console for the cursor moving bit: CursorTop,
CursorLeft, KeyInfo, ConsoleKey, KeyAvailable and Read(). You may
also need System.Threading.Thread.Sleep() to wait for a key to be
pressed.

I don't know how much of a hint you want, but don't read any further
if you don't want to see a very simple demonstration.

rossum



static void Main() {
string twentyDots = new string('.', 20);

for (int i = 0; i < 10; ++i) {
Console.WriteLine(twentyDots);
} // end for
Console.WriteLine("Use arrow keys to move or X to exit.");

// Initial position of cursor
Console.CursorLeft = 9;
Console.CursorTop = 4;

// Loop to read keyboard
bool finished = false;
ConsoleKeyInfo keyInfo = new ConsoleKeyInfo();
do {
// Wait until key is pressed.
while (Console.KeyAvailable == false) {
Thread.Sleep(100);
} // end while

// 'true' stops key echo.
keyInfo = Console.ReadKey(true);
switch (keyInfo.Key) {
case ConsoleKey.DownArrow:
++Console.CursorTop;
break;
case ConsoleKey.LeftArrow:
--Console.CursorLeft;
break;
case ConsoleKey.RightArrow:
++Console.CursorLeft;
break;
case ConsoleKey.UpArrow:
--Console.CursorTop;
break;
case ConsoleKey.X:
finished = true;
break;
default:
break;
} // end switch
} while (!finished);
} // end Main()


Dec 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: soundchaser | last post by:
I'm looking for a simple but complete example of creating a VB.Net ActiveX / COM component from a C Library. One should be able to use it by calling the Server.CreateObject method from an ASP...
4
by: Raed Sawalha | last post by:
I'm trying to create Element as following name MyElement:InitialName XmlElement elem = doc.CreateElement("MyElement:InitialName"); when generate the XML the tag is truncated as ONLY...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
12
by: Mark | last post by:
Hello, in a simple console application I try to create a file with some code like: FileStream file = new FileStream("test.txt", FileMode.OpenOrCreate, FileAccess.Write); StreamWriter sw = new...
9
by: Rotzooi | last post by:
Hi, I have a VB.NET Service application that's running fine under the Local System account. But for configuration purposes I don't want to be dependent on modifying the registry manually or...
0
by: Lemune | last post by:
Hello everyone. I'm creating windows service application to capture data from my PABX, and send the data to sql server. My question is how could my application know when that PABX is sending data...
12
by: Noam | last post by:
I had originally written a program as a c# console application. The program used a reference that I wrote in c++. Later I was told to re-write the application as a windows service. When the service...
1
by: twdo | last post by:
OK. I am totally frustrated here. I have a setup project within Visual Studio. That setup project is calling a class library project by the use of Custom Actions. Within that class library (my...
1
by: DarkGiank | last post by:
Hi, im new to csharp and im trying to create a class that can change the application database without no rewriting all connection code... but cause some reason it is not working... it tells me that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.