简体   繁体   中英

Vb.net Mouse location

I try to make a maze. When mouse hit the wall it need to go back to panel1 position and it going back, but when i move the mouse it coming back where i hit the wall and the event is useless. I can go to finish through the wall. Video Link .

Public Sub New()
    InitializeComponent()
    Start()
End Sub

Private Sub Start()
    Dim StartPoint = Panel1.Location()
    StartPoint.Offset(20, 20)
    Cursor.Position = PointToScreen(StartPoint)
End Sub

Private Sub Finish_MouseEnter(sender As Object, e As EventArgs) Handles Label17.MouseEnter
    MessageBox.Show("Gz")
End Sub

Private Sub WallHit_MouseEnter(sender As Object, e As EventArgs) Handles Label1.MouseEnter, Panel1.MouseEnter, Label9.MouseEnter, Label8.MouseEnter, Label7.MouseEnter, Label6.MouseEnter, Label5.MouseEnter, Label4.MouseEnter, Label3.MouseEnter, Label2.MouseEnter, Label16.MouseEnter, Label15.MouseEnter, Label14.MouseEnter, Label13.MouseEnter, Label12.MouseEnter
    Start()
End Sub

Solved. I run my app in a virtual machine (windows 10). The problem appear when i run in vm but when i run it in outside of vm my app work correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM