i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
Go Back  Xtreme Visual Basic Talk > > > i need help getting a picturebox(my character)to move


Reply
 
Thread Tools Display Modes
  #21  
Old 01-16-2007, 07:14 PM
bernwood bernwood is offline
Newcomer
 
Join Date: Jan 2007
Posts: 10
Default


Private Sub outsidetown_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.Up Then
inty = inty - 10

End If
If e.KeyCode = Keys.Down Then
inty = inty + 10

End If

PictureBox1.Location = New System.Drawing.Point(intx, inty)
If e.KeyCode = Keys.Left Then
intx = intx - 10
End If
If e.KeyCode = Keys.Right Then
intx = intx + 10
End If

PictureBox1.Location = New System.Drawing.Point(intx, inty)
End Sub
Reply With Quote
  #22  
Old 01-16-2007, 11:02 PM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

Here's a more refined way, but yes, that's how it's done.


Private Sub outsidetown_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.Up Then
inty = inty - 10
ElseIf e.KeyCode = Keys.Down Then
inty = inty + 10
ElseIf e.KeyCode = Keys.Left Then
intx = intx - 10
ElseIf e.KeyCode = Keys.Right Then
intx = intx + 10
Else
Exit Sub
End If

PictureBox1.Location = New System.Drawing.Point(intx, inty)

End Sub
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
 
i need help getting a picturebox(my character)to move
i need help getting a picturebox(my character)to move
 
-->