•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 361,561 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,029 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 365 | Replies: 2
![]() |
•
•
Join Date: Jan 2008
Posts: 15
Reputation:
Rep Power: 1
Solved Threads: 0
I'm sure there is a simple way to make a keystrok such as the up arrow adjust the location of the picture box, however I don't know how to tell the program to perhaps
when a key is pressed...
help please!
picturebox1.location = picturebox1.location + 1
when a key is pressed...
help please!
handle it with keyDown Event.
this following code is form keydown event, you can do same with other controls.
this following code is form keydown event, you can do same with other controls.
vb.net Syntax (Toggle Plain Text)
Private Sub Search_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown If e.KeyCode = Keys.Up Then 'PictureBox1.Top -= 10 MsgBox("Key Up Pressed") ElseIf e.KeyCode = Keys.Down Then 'PictureBox1.Top += 10 MsgBox("Key Top Pressed") ElseIf e.KeyCode = Keys.Left Then 'PictureBox1.Left -= 10 MsgBox("Key Left Pressed") ElseIf e.KeyCode = Keys.Right Then 'PictureBox1.Left += 10 MsgBox("Key Right Pressed") End If End Sub
Last edited by Jx_Man : May 10th, 2008 at 1:36 am.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
Other Threads in the VB.NET Forum
- Previous Thread: Make program work on other PCs
- Next Thread: topic for final year project



Linear Mode