|
-
Jul 28th, 2007, 04:55 AM
#1
Thread Starter
Junior Member
{RESOLVED} [2005] keypress
i have just changed from using vb6 to vb2005 and i am trying to catch up with some of the vb6 ways of programming like. when you press left on the arrow keys the labbel moves to the left, and so on.
this is how i would have done it in vb
vb6 Code:
Dim KeyAscii As Integer
Select Case KeyAscii
Case 73
label1.Top = label1.Top + 1000
Case 77
label1.Top = label1.Top - 120
Case 74
label1.Top = label1.Left + 120
Case 76
label1.Top = label1.Left - 120
End Select
End Sub
how would i do the same in vb2005,
ps. i have searched the forums and carnt see much their to help me most of the results was how tot do it in vb6.
regards, pip
thank you in advance.
Last edited by pipwilky; Jul 28th, 2007 at 01:31 PM.
Reason: {RESOLVED}
Currnet Projects Working on
Games
CrossWord (finsihed)
Programms
Ip IM
an more i will up date later
Please Mark all resloved posts with [RESLOVED] and a green tick.
-
Jul 28th, 2007, 05:05 AM
#2
Hyperactive Member
If my post helps , please feel free to rate it 
-
Jul 28th, 2007, 05:10 AM
#3
Re: [2005] keypress
 Originally Posted by pipwilky
i have just changed from using vb6 to vb2005 and i am trying to catch up with some of the vb6 ways of programming like. when you press left on the arrow keys the labbel moves to the left, and so on.
this is how i would have done it in vb
vb6 Code:
Dim KeyAscii As Integer
Select Case KeyAscii
Case 73
label1.Top = label1.Top + 1000
Case 77
label1.Top = label1.Top - 120
Case 74
label1.Top = label1.Left + 120
Case 76
label1.Top = label1.Left - 120
End Select
End Sub
how would i do the same in vb2005,
ps. i have searched the forums and carnt see much their to help me most of the results was how tot do it in vb6.
regards, pip
thank you in advance.
Hi,
To change the position of a label you can do it like this;
Code:
Label1.Location = New Point(40, 20) ' (40,20)= example
Hope it helps,
sparrow1
-
Jul 28th, 2007, 01:29 PM
#4
Thread Starter
Junior Member
Re: [2005] keypress
ye thanks both of you very help full...
Currnet Projects Working on
Games
CrossWord (finsihed)
Programms
Ip IM
an more i will up date later
Please Mark all resloved posts with [RESLOVED] and a green tick.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|