Hallo
Ich komm nicht mehr weiter
Ich Versuche die ganze zeit das wen label1 auf location 35;15 drauf ist das label2 dann grün leuchtet
Ich habe es schon geschaft das ich label1 mit den Pfeiltesten bewegen kann aber
ich weis nicht was ich eingeben muss wenn es auf Location 35;15 ist
Ich komm nicht mehr weiter
Ich Versuche die ganze zeit das wen label1 auf location 35;15 drauf ist das label2 dann grün leuchtet
Ich habe es schon geschaft das ich label1 mit den Pfeiltesten bewegen kann aber
ich weis nicht was ich eingeben muss wenn es auf Location 35;15 ist
VB.NET-Quellcode
- Public Class Form1
- Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
- If e.KeyCode = Keys.Down Then
- Dim new_location As Point = New Point(Label2.Location.X, Label2.Location.Y + 10)
- Label2.Location = new_location
- End If
- If e.KeyCode = Keys.Up Then
- Dim new_location As Point = New Point(Label2.Location.X, Label2.Location.Y - 10)
- Label2.Location = new_location
- End If
- If e.KeyCode = Keys.Right Then
- Dim new_location As Point = New Point(Label2.Location.X + 10, Label2.Location.Y)
- Label2.Location = new_location
- End If
- If e.KeyCode = Keys.Left Then
- Dim new_location As Point = New Point(Label2.Location.X - 10, Label2.Location.Y)
- Label2.Location = new_location
- End If
- End Sub