Hello,
lets say for example i want to let the program play a .wav sound with My.Computer.Audio.Play by pressing a key.
I already have the function to register key presses and i want to give the user the choice for which hotkey he wants to press to play the sound.
Because there are some weird keys in System.Windows.Forms.Keys like ZOOM, Snapshot, Volume up/down ... i sorted these ones out and added the other ones everyone has on a normal keyboard into a list i added to the combobox items of the combobox in the form.
My question is:
How can i convert the combobox item strings of the keys into the actual object names of the keys like Keys.Escape or Keys.Delete so that i can use them like that in the program?
The method for detecting keypresses i use only accepts objects of the type System.Windows.Forms.Keys so i can't just code it like:
Any ideas?
lets say for example i want to let the program play a .wav sound with My.Computer.Audio.Play by pressing a key.
I already have the function to register key presses and i want to give the user the choice for which hotkey he wants to press to play the sound.
Because there are some weird keys in System.Windows.Forms.Keys like ZOOM, Snapshot, Volume up/down ... i sorted these ones out and added the other ones everyone has on a normal keyboard into a list i added to the combobox items of the combobox in the form.
My question is:
How can i convert the combobox item strings of the keys into the actual object names of the keys like Keys.Escape or Keys.Delete so that i can use them like that in the program?
The method for detecting keypresses i use only accepts objects of the type System.Windows.Forms.Keys so i can't just code it like:
VB.NET:
If GetKeyPress(ComboBox1.text) Then
...
End If