1,105,578 Community Members

Using shortcut in vb6

Member Avatar
belber
Light Poster
31 posts since Jan 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 1 [?]
 
0
 

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...

Member Avatar
Jx_Man
Senior Poster
3,543 posts since Nov 2007
Reputation Points: 987 [?]
Q&As Helped to Solve: 542 [?]
Skill Endorsements: 74 [?]
Featured
 
0
 

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

Member Avatar
belber
Light Poster
31 posts since Jan 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 1 [?]
 
1
 

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

Member Avatar
Jx_Man
Senior Poster
3,543 posts since Nov 2007
Reputation Points: 987 [?]
Q&As Helped to Solve: 542 [?]
Skill Endorsements: 74 [?]
Featured
 
1
 

See if this helps :

Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
    Unload Me
End If
End Sub
Member Avatar
ChrisPadgham
Posting Pro in Training
450 posts since Sep 2009
Reputation Points: 113 [?]
Q&As Helped to Solve: 90 [?]
Skill Endorsements: 8 [?]
 
0
 

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

Member Avatar
belber
Light Poster
31 posts since Jan 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 1 [?]
 
0
 

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...

Member Avatar
Jx_Man
Senior Poster
3,543 posts since Nov 2007
Reputation Points: 987 [?]
Q&As Helped to Solve: 542 [?]
Skill Endorsements: 74 [?]
Featured
 
0
 

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

Question Answered as of 2 Years Ago by Jx_Man and ChrisPadgham
Member Avatar
mustaffa hasan
Light Poster
31 posts since Dec 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 3 [?]
Skill Endorsements: 0 [?]
 
0
 

form_keypress
if keyascii=1 then
unload me
end sub

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article