Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Getting an ascii character
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JSBN




PostPosted: Sat May 24, 2003 2:16 pm   Post subject: Getting an ascii character

Any one know how i'd go about doing a getch type thing in VB (w/o a promp if possible)?
[/code]
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat May 24, 2003 4:43 pm   Post subject: (No subject)

code:

Private Sub Form_KeyPress(KeyAscii As Integer)
Print Chr(KeyAscii)
End Sub
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
JSBN




PostPosted: Sat May 24, 2003 5:35 pm   Post subject: (No subject)

but that only works when i have it in a program by its self :/
Tony




PostPosted: Sat May 24, 2003 8:13 pm   Post subject: (No subject)

what do you mean?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
JSBN




PostPosted: Sun May 25, 2003 1:39 pm   Post subject: (No subject)

nothing happens when i put that code in.... it only seems to work when i put it in it's own seperate program. My program has buttons and other things that i think might interfere with your code's functionallity.
Tony




PostPosted: Sun May 25, 2003 1:47 pm   Post subject: (No subject)

well since its form_keypress you need to have your form active.. click on some empty space...

its also not gonna work if you named your form anything other then form
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
JSBN




PostPosted: Sun May 25, 2003 1:56 pm   Post subject: (No subject)

well i changed it to Form1_KeyPress......
and it still doesn't work :/
Tony




PostPosted: Sun May 25, 2003 5:11 pm   Post subject: (No subject)

post your files, I'll help you edit it to make it work
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
JSBN




PostPosted: Sun May 25, 2003 5:21 pm   Post subject: (No subject)

hmm.... because i am not mod here, i cant attatch. i'll just pm them to u k?
FDisk87




PostPosted: Fri Dec 05, 2003 4:51 pm   Post subject: (No subject)

Make sure the key preview property is set to true on the form designer.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: