We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,459 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Using shortcut in vb6

hey all, i wan't ask..
how make shortcut in form..,
did i've to use keyup or keydown event ..???

i need some reference pliss...

4
Contributors
7
Replies
6 Days
Discussion Span
1 Year Ago
Last Updated
8
Views
Question
Answered
belber
Light Poster
31 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 1

I don't get what you want to exactly.
Please more specify.

Jx_Man
Senior Poster
3,553 posts since Nov 2007
Reputation Points: 1,500
Solved Threads: 531
Skill Endorsements: 65

hmmm....
i have one form, when i press esc in my keyboard form will close...
how do that with code...???

belber
Light Poster
31 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 1

See if this helps :

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    Unload Me
End If
End Sub
Jx_Man
Senior Poster
3,553 posts since Nov 2007
Reputation Points: 1,500
Solved Threads: 531
Skill Endorsements: 65

From memory, I think you also need to set the keypreview property on the form otherwise the keypress will be sent to the control that has focus

ChrisPadgham
Posting Pro in Training
451 posts since Sep 2009
Reputation Points: 127
Solved Threads: 88
Skill Endorsements: 5

it's help me...

and i was have code for that too, this my code :

Private Sub TxtID_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbkeyF1 Then
Form2.Show 1
End if
End sub

This Thread Solve, thanks...

belber
Light Poster
31 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 1

Good. :D
Don't Forget to mark this thread as Solved.

Jx_Man
Senior Poster
3,553 posts since Nov 2007
Reputation Points: 1,500
Solved Threads: 531
Skill Endorsements: 65
Question Answered as of 1 Year Ago by Jx_Man and ChrisPadgham

form_keypress
if keyascii=1 then
unload me
end sub

mustaffa hasan
Light Poster
31 posts since Dec 2010
Reputation Points: 10
Solved Threads: 3
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0777 seconds using 2.67MB