Dim Loc As Point Select Case e.KeyCode Case Keys.Left If Not picPlayer.Location.X - 5 < 0 Then Loc = New Point(picPlayer.Location.X - 5, picPlayer.Location.Y) picPlayer.Location = Loc End If Case Keys.Right If Not picPlayer.Location.X + 5 > Me.Width - picPlayer.Width - 5 Then Loc = New Point(picPlayer.Location.X + 5, picPlayer.Location.Y) picPlayer.Location = Loc End If Case Keys.Up If Not picPlayer.Location.Y - 5 < 0 Then Loc = New Point(picPlayer.Location.X, picPlayer.Location.Y - 5) picPlayer.Location = Loc End If Case Keys.Down If Not picPlayer.Location.Y - 5 > Me.Height - picPlayer.Height * 1.5 Then Loc = New Point(picPlayer.Location.X, picPlayer.Location.Y + 5) picPlayer.Location = Loc End If End Select
Please help i can go to the edgeg of the form and itll stop but if i put a buton on the form i go through the button basicly i want the button to ack like a border nd when i hiit the edge of the button on all sides (i would not wnt to go through it just stop)
Plz email me at j.a.carley@hotmail.com

New Topic/Question
Reply




MultiQuote




|