[RESOLVED] "Or" problem...
Do Or commands not work within Select Case starements? This code don't work at all. What gives?
Code:
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Select Case e.KeyCode
Case Keys.NumPad0 Or Keys.D0
My.Computer.Audio.Play(My.Resources.click_x, AudioPlayMode.Background)
lblInput.Text += "0"
lblInput.Focus() 'don't want a button getting focus because it makes border around it
End Select
End Sub
Also is there a nice easy way to make the button look like it was actually pressed down when the key for it is pressed just like when the mouse is held down over it?
Re: [RESOLVED] "Or" problem...
The secret to using MSDN, I have found, is to use the index. I'm talking about the local copy you would have installed along with VS, not the online version. I very rarely use the search feature. Whenever I know the name of what you're looking for, be it a type, member, key word or whatever, I type it straight into the index. That's exactly what I did in this case to get information on the Select Case statement.
There are numerous examples of people asking "how do I do X with class Y". I always recommend that those people do as I've suggested here and use the index to find the documentation for class Y. The first thing to do is read the class description. If that doesn't give you what you need then the next thing to do is follow the link to the member listing and read the names and descriptions to see if anything looks likely. If it does, follow the link and read more about it. That's what I've done right from the start. Trust me, it's the best way to learn. I've learned plenty on all sorts of things I wasn't even looking for as a result.
I'd also suggest copious use of the F1 key. You can select anything in the designer or code window and press F1 to be taken straight to the most likely topic.
Folow this advice and you'll be the one to benefit. This is the best help you can get. :)
Re: [RESOLVED] "Or" problem...
Great adivce and thank you for it.
I still like the community here and find ya'll a great help.