By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 2,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

CONSOLE: how to do "Press Any Key To Continue"

P: n/a
I'm using VB.Net. I've tried using Console.Read() but it requires a
line-terminator before it finishes (doesn't that mean it's functionally
equivalent to ReadLine() -- why have it then?). I've tried
Console.In.ReadBlock(), too, with no success.

So, along these lines, how would I implement, simply, a "Press Any Key to
Continue" routine or, more complex, a text menu in a Console app to get a
single character?

i.e.
1. Declare your hate for VB.Net
2. Declare your love for VB.Net
X. No Comment
Enter Your Choice [1,2,X]:

Thanks, folks.
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Paul Johnston" <pjoh_DELETETHIS_nston@lw_DELETETHIS_cb.ca> wrote in message
news:uk******************@TK2MSFTNGP09.phx.gbl...
I'm using VB.Net. I've tried using Console.Read() but it requires a
line-terminator before it finishes (doesn't that mean it's functionally
equivalent to ReadLine() -- why have it then?). I've tried
Console.In.ReadBlock(), too, with no success.

So, along these lines, how would I implement, simply, a "Press Any Key to
Continue" routine or, more complex, a text menu in a Console app to get a
single character?

i.e.
1. Declare your hate for VB.Net
2. Declare your love for VB.Net
X. No Comment
Enter Your Choice [1,2,X]:


Console.In.ReadBlock(...) might be what you're looking for.
Jul 21 '05 #2

P: n/a
On Wed, 25 Feb 2004 13:45:48 -0500, "Paul Johnston"
<pjoh_DELETETHIS_nston@lw_DELETETHIS_cb.ca> wrote:
I'm using VB.Net. I've tried using Console.Read() but it requires a
line-terminator before it finishes (doesn't that mean it's functionally
equivalent to ReadLine() -- why have it then?). I've tried
Console.In.ReadBlock(), too, with no success.

So, along these lines, how would I implement, simply, a "Press Any Key to
Continue" routine or, more complex, a text menu in a Console app to get a
single character?

i.e.
1. Declare your hate for VB.Net
2. Declare your love for VB.Net
X. No Comment
Enter Your Choice [1,2,X]:

Thanks, folks.

You might need to wait until Whidbey is out - see these articles on
additional console-mode support in Whidbey (next version of Visual
Studio):

"Console Support In Whidbey
Whidbey is adding support for the full range of Console features
provided by Win32, such as manipulating the full console window,
applying colors, and reading directly from keyboard.
........
Keyboard input is accessed via the KeyAvailable, ReadKey,
TreatControlCAsInput members and the CancelKeyPress event. "
http://wesnerm.blogs.com/net_undocum...e_support.html

"Not Your Grandpa's Console
The BCL class that gains the most new features is the Console class.
Prior to the new features, the Console class allowed limited input and
output buffer access, and interactions limited to very linear
scenarios. Reading and writing task interactions with the screen
buffer were dictated by the simple Read, Write, ReadLine, and
WriteLine methods."

http://www.devx.com/codemag/Article/20150/0/page/5

Marc

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.