|
-
Sep 27th, 2005, 05:27 PM
#1
Thread Starter
New Member
console app and determining witch key was pressed
Hi !
i have problem with console app
how to determine witch key was pressed and do some action for it ex:
1. start the app
2. waiting for user action
3. pressing a key ( ex F3 )
4. app make an action
5. waiting for user action
[...]
can someone help me ? from 2 days i can't find anything about this ...
thx for replies !
p.s. i don't mean something like this:
VB Code:
asciiCode = CInt(Console.Read()) ' Returns the ascii code of the entered character
' 13 is the code for enter
If asciiCode = 13 Then
Exit Do
End If
but something with KeyDown ( if it's possible )
-
Sep 27th, 2005, 05:32 PM
#2
Re: console app and determining witch key was pressed
Use the form KeyDown event... ex. Form1_KeyDown
-
Sep 27th, 2005, 10:55 PM
#3
Re: console app and determining witch key was pressed
The user interface that you see when you run a console app has nothing to do with your app. That interface is provided by the OS, so events related to the window mean nothing to your app. Your app doesn't even know there is a GUI, as the idea behind console apps is that they don't need one. All it has to interact with the world are three streams: stdin, stdout and stderr. They are the only (normal) ways to get data into and out of a console app. If you want GUI-related events then I suggest you create a Windows app and provide a TextBox that your user can use in the same way as they would use a command window.
-
Sep 27th, 2005, 11:15 PM
#4
Thread Starter
New Member
Re: console app and determining witch key was pressed
no, it's console application without any GUI
i heard that i should use overloads, but i don't know how to do this,
i did't find any example of it
-
Sep 27th, 2005, 11:19 PM
#5
Re: console app and determining witch key was pressed
-
Sep 29th, 2005, 11:31 AM
#6
Thread Starter
New Member
Re: console app and determining witch key was pressed
sorry for late answer, i work a lot ( in poland i have to )
jmcilhinney i don't know, on polish forum about vb.net someone just tell me that i should use overloads, i'm newbe and i don't even know what's this
I just look for simple example of using keyboard shortcuts in console application
like ctrl+a or F5
thx, and sorry for late answer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|