Hi Leute.
Ich wollte mal fragen, warum bei folgendem Event nichts passiert wenn ich eine Taste drücken.
Die textbox bleibt leer, und wenn ich A drücke kommt auch keine MSGBOX.
Hier mal der code:
Ich hoffe ihr könnt mihr helfen. Ich habe bestimmt nur was ganz simples übersehen, finde es aber nicht.
Danke schonmal.
shutdown
Ich wollte mal fragen, warum bei folgendem Event nichts passiert wenn ich eine Taste drücken.
Die textbox bleibt leer, und wenn ich A drücke kommt auch keine MSGBOX.
Hier mal der code:
VB.NET-Quellcode
- Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
- Select Case e.KeyCode
- Case Keys.A
- TextBox1.Text = TextBox1.Text + "a"
- MsgBox("a")
- Case Keys.Q
- TextBox1.Text = TextBox1.Text + "q"
- Case Keys.W
- TextBox1.Text = TextBox1.Text + "w"
- Case Keys.E
- TextBox1.Text = TextBox1.Text + "e"
- Case Keys.R
- TextBox1.Text = TextBox1.Text + "r"
- Case Keys.T
- TextBox1.Text = TextBox1.Text + "t"
- Case Keys.Z
- TextBox1.Text = TextBox1.Text + "z"
- Case Keys.U
- TextBox1.Text = TextBox1.Text + "u"
- Case Keys.I
- TextBox1.Text = TextBox1.Text + "i"
- Case Keys.O
- TextBox1.Text = TextBox1.Text + "o"
- Case Keys.P
- TextBox1.Text = TextBox1.Text + "p"
- Case Keys.D
- TextBox1.Text = TextBox1.Text + "d"
- Case Keys.S
- TextBox1.Text = TextBox1.Text + "s"
- Case Keys.F
- TextBox1.Text = TextBox1.Text + "f"
- Case Keys.G
- TextBox1.Text = TextBox1.Text + "g"
- Case Keys.H
- TextBox1.Text = TextBox1.Text + "h"
- Case Keys.J
- TextBox1.Text = TextBox1.Text + "j"
- Case Keys.K
- TextBox1.Text = TextBox1.Text + "k"
- Case Keys.L
- TextBox1.Text = TextBox1.Text + "l"
- Case Keys.Y
- TextBox1.Text = TextBox1.Text + "y"
- Case Keys.X
- TextBox1.Text = TextBox1.Text + "x"
- Case Keys.C
- TextBox1.Text = TextBox1.Text + "c"
- Case Keys.V
- TextBox1.Text = TextBox1.Text + "v"
- Case Keys.B
- TextBox1.Text = TextBox1.Text + "b"
- Case Keys.N
- TextBox1.Text = TextBox1.Text + "n"
- Case Keys.M
- TextBox1.Text = TextBox1.Text + "m"
- Case Keys.Alt
- TextBox1.Text = TextBox1.Text + " <Alt> "
- Case Keys.Back
- TextBox1.Text = TextBox1.Text + " <Zurück> "
- Case Keys.CapsLock
- TextBox1.Text = TextBox1.Text + " <Grosschreib> "
- Case Keys.Control
- TextBox1.Text = TextBox1.Text + " <Strg> "
- Case Keys.Delete
- TextBox1.Text = TextBox1.Text + " <Löschen> "
- Case Keys.Down
- TextBox1.Text = TextBox1.Text + " <Runter> "
- Case Keys.Enter
- TextBox1.Text = TextBox1.Text + " <Enter> " + vbCrLf
- Case Keys.Escape
- TextBox1.Text = TextBox1.Text + " <Escape> "
- Case Keys.F1
- TextBox1.Text = TextBox1.Text + " <F1> "
- Case Keys.F2
- TextBox1.Text = TextBox1.Text + " <F2> "
- Case Keys.F3
- TextBox1.Text = TextBox1.Text + " <F3> "
- Case Keys.F4
- TextBox1.Text = TextBox1.Text + " <F4> "
- Case Keys.F5
- TextBox1.Text = TextBox1.Text + " <F5> "
- Case Keys.F6
- TextBox1.Text = TextBox1.Text + " <F6> "
- Case Keys.F7
- TextBox1.Text = TextBox1.Text + " <F7> "
- Case Keys.F8
- TextBox1.Text = TextBox1.Text + " <F8> "
- Case Keys.F9
- TextBox1.Text = TextBox1.Text + " <F9> "
- Case Keys.F10
- TextBox1.Text = TextBox1.Text + " <F10> "
- Case Keys.F11
- TextBox1.Text = TextBox1.Text + " <F11> "
- Case Keys.F12
- TextBox1.Text = TextBox1.Text + " <F12> "
- Case Keys.F13
- TextBox1.Text = TextBox1.Text + " <F13> "
- Case Keys.LButton
- TextBox1.Text = TextBox1.Text + " <Maus links> "
- Case Keys.LControlKey
- TextBox1.Text = TextBox1.Text + " <Strg links> "
- Case Keys.Left
- TextBox1.Text = TextBox1.Text + " <Links> "
- Case Keys.NumLock
- TextBox1.Text = TextBox1.Text + " <NumLock> "
- Case Keys.NumPad0
- TextBox1.Text = TextBox1.Text + " <0> "
- Case Keys.NumPad1
- TextBox1.Text = TextBox1.Text + " <1> "
- Case Keys.NumPad2
- TextBox1.Text = TextBox1.Text + " <2> "
- Case Keys.NumPad3
- TextBox1.Text = TextBox1.Text + " <3> "
- Case Keys.NumPad4
- TextBox1.Text = TextBox1.Text + " <4> "
- Case Keys.NumPad5
- TextBox1.Text = TextBox1.Text + " <5> "
- Case Keys.NumPad6
- TextBox1.Text = TextBox1.Text + " <6> "
- Case Keys.NumPad7
- TextBox1.Text = TextBox1.Text + " <7> "
- Case Keys.NumPad8
- TextBox1.Text = TextBox1.Text + " <8> "
- Case Keys.NumPad9
- TextBox1.Text = TextBox1.Text + " <9> "
- Case Keys.PageDown
- TextBox1.Text = TextBox1.Text + " <Bild runter> "
- Case Keys.PageUp
- TextBox1.Text = TextBox1.Text + " <Bild rauf> "
- Case Keys.RButton
- TextBox1.Text = TextBox1.Text + " <Maus rechts> "
- Case Keys.Return
- TextBox1.Text = TextBox1.Text + " <Return> "
- Case Keys.Right
- TextBox1.Text = TextBox1.Text + " <Rechts> "
- Case Keys.Shift
- TextBox1.Text = TextBox1.Text + " <Shift> "
- Case Keys.Up
- TextBox1.Text = TextBox1.Text + " <Hoch> "
- Case Keys.Space
- TextBox1.Text = TextBox1.Text + (" ")
- End Select
- End Sub
Ich hoffe ihr könnt mihr helfen. Ich habe bestimmt nur was ganz simples übersehen, finde es aber nicht.
Danke schonmal.
shutdown