Click here to Skip to main content
15,885,028 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I wrote a project in vb.net. Can you help me display my favorite forms with the 25 and 2a key combination?
example: &i pressed 25 open form1 and i pressed 2a open form2

What I have tried:

if e.keycode=keys.numpad2 then
if e.keycode=keys.numpad5 then
form1.show()
end if
end if
Posted
Updated 18-Jul-21 0:55am

1 solution

VB
if e.keycode=keys.numpad2 then
if e.keycode=keys.numpad5 then

A single keycode cannot equal 2 and also 5 at the same time. You should use a single key value with one or more of the modifier keys (Alt, Ctrl, Shift).
 
Share this answer
 
Comments
Donya Barzegar 19-Jul-21 1:33am    
I do not want to use ctrl, shift, alt I want to use a combination of two numbers like 25, 3a, 4b, 66, ...
Richard MacCutchan 19-Jul-21 3:41am    
Then you need to capture each pair of keys one after the other and check them when you have the complete pair. there is no way you can get the two keys at the same time. That is why the modifier keys exist.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900