hello mates today i will be showing you how to move items using vb
and how to make hot keys
first of all lets start with the items location and moving them
lets say that i want my button to be moved to left when i press S here is the code
but you must do something before inserting the code
photo :
[img]http://www3.picturepush.com/photo/a/8580861/640/8580861.png[/img]
lets say i want the program to beep when button1 is on button2
code :
lets say that i want to make escape close the program that is what we call hot keys
code :
of course you must do the same thing we did in the previous picture
now lets see our project :
pictures:
[img]http://www5.picturepush.com/photo/a/8580898/640/8580898.png[/img]
[img]http://www4.picturepush.com/photo/a/8580902/640/8580902.png[/img]
[img]http://www1.picturepush.com/photo/a/8580914/640/8580914.png[/img]
firs one to move left
second one to move right
third one to move to the top
4th one to move down
code :
button 1 (keydown) :
done ? button code :
timer1 code :
form load code :
all the code together :
so basically this is a game you must take button1 to button 7 and press done ? to get 500 points on the label but i'm still working on the cars as you can see they are so fast and when button1 is slow so the program dont detect them that they are on button 1 location to remove 500 points from the label but like i said before i'm working on it :)
this suppose to be a stupid car game lol you must get the car(button1) to the garage(button7) without hitting the other cars but you can hit them
it wont do anything it is not working i will fix it in the next tutorial
download the exe file :
http://www.mediafire.com/?0m270ljlgcmd293
virus scan :
http://vscan.novirusthanks.org/analysis/...uNC1leGU=/
File Info
Report date: 2012-06-26 11:20:15 (GMT 1)
File name: windowsapplication4-exe
File size: 20480 bytes
MD5 Hash: 8309ec50651cc733bc9f67cafe0b78f9
SHA1 Hash: de147e444e3450883bd5e852525a75fecc31f275
Detection rate: 1 on 14 (7%)
Status: INFECTED
Detections
Asquared -
Avast -
AVG -
Avira -
BitDefender -
ClamAV -
Comodo -
DrWeb - Trojan.DownLoader4.61162
Fprot -
IkarusT3 -
Panda -
STOPZilla -
TrendMicro -
VBA32 -
Scan report generated by
NoVirusThanks.org
download all the project :
http://www.mediafire.com/?t9tugh14i0annwt
it got detect because we used allot of keys and the av think that it is a keylogger
hope i helped
bets regards
illusion
and how to make hot keys
first of all lets start with the items location and moving them
lets say that i want my button to be moved to left when i press S here is the code
Code
If e.KeyCode = Keys.s Then Button1.Left += 1photo :
[img]http://www3.picturepush.com/photo/a/8580861/640/8580861.png[/img]
lets say i want the program to beep when button1 is on button2
code :
Code
If Button1.Location = Button2.Location Then
beep()
End Iflets say that i want to make escape close the program that is what we call hot keys
code :
Code
If e.KeyCode = Keys.Escape Then endnow lets see our project :
pictures:
[img]http://www5.picturepush.com/photo/a/8580898/640/8580898.png[/img]
[img]http://www4.picturepush.com/photo/a/8580902/640/8580902.png[/img]
[img]http://www1.picturepush.com/photo/a/8580914/640/8580914.png[/img]
firs one to move left
second one to move right
third one to move to the top
4th one to move down
code :
button 1 (keydown) :
Code
If e.KeyCode = Keys.D Then Button1.Left += 1
If e.KeyCode = Keys.A Then Button1.Left -= 1
If e.KeyCode = Keys.W Then Button1.Top -= 1
If e.KeyCode = Keys.Escape Then
End If
Button1.Top += 1
If e.KeyCode = Keys.S And e.KeyCode = Keys.RShiftKey Then
For i = 1 To 30
Button1.Top += 1
Next
End IfCode
If Button1.Location = Button7.Location Then
Label1.Text += 500
End If
Button1.Focus()Code
For i = 1 To 90
Button2.Left -= 10
Next
For i = 1 To 90
Button2.Left += 10
Next
For i = 1 To 90
Button3.Left -= 10
Next
For i = 1 To 90
Button3.Left += 10
Next
For i = 1 To 90
Button4.Left -= 10
Next
For i = 1 To 90
Button4.Left += 10
Next
For i = 1 To 90
Button5.Left -= 10
Next
For i = 1 To 90
Button5.Left += 10
NextCode
Timer1.Start()
If Button1.Location = Button2.Location Or Button1.Location = Button3.Location Or Button1.Location = Button4.Location Or
Button1.Location = Button5.Location Or Button1.Location = Button6.Location Then
Label1.Text -= 500
End Ifall the code together :
Code
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
If Button1.Location = Button2.Location Or Button1.Location = Button3.Location Or Button1.Location = Button4.Location Or
Button1.Location = Button5.Location Or Button1.Location = Button6.Location Then
Label1.Text -= 500
End If
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Private Sub Button1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Button1.KeyDown
If e.KeyCode = Keys.D Then Button1.Left += 1
If e.KeyCode = Keys.A Then Button1.Left -= 1
If e.KeyCode = Keys.W Then Button1.Top -= 1
If e.KeyCode = Keys.Escape Then
End If
Button1.Top += 1
If e.KeyCode = Keys.S And e.KeyCode = Keys.RShiftKey Then
For i = 1 To 30
Button1.Top += 1
Next
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
For i = 1 To 90
Button2.Left -= 10
Next
For i = 1 To 90
Button2.Left += 10
Next
For i = 1 To 90
Button3.Left -= 10
Next
For i = 1 To 90
Button3.Left += 10
Next
For i = 1 To 90
Button4.Left -= 10
Next
For i = 1 To 90
Button4.Left += 10
Next
For i = 1 To 90
Button5.Left -= 10
Next
For i = 1 To 90
Button5.Left += 10
Next
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
If Button1.Location = Button7.Location Then
Label1.Text += 500
End If
Button1.Focus()
End Sub
End Classso basically this is a game you must take button1 to button 7 and press done ? to get 500 points on the label but i'm still working on the cars as you can see they are so fast and when button1 is slow so the program dont detect them that they are on button 1 location to remove 500 points from the label but like i said before i'm working on it :)
this suppose to be a stupid car game lol you must get the car(button1) to the garage(button7) without hitting the other cars but you can hit them
it wont do anything it is not working i will fix it in the next tutorial
download the exe file :
http://www.mediafire.com/?0m270ljlgcmd293
virus scan :
http://vscan.novirusthanks.org/analysis/...uNC1leGU=/
File Info
Report date: 2012-06-26 11:20:15 (GMT 1)
File name: windowsapplication4-exe
File size: 20480 bytes
MD5 Hash: 8309ec50651cc733bc9f67cafe0b78f9
SHA1 Hash: de147e444e3450883bd5e852525a75fecc31f275
Detection rate: 1 on 14 (7%)
Status: INFECTED
Detections
Asquared -
Avast -
AVG -
Avira -
BitDefender -
ClamAV -
Comodo -
DrWeb - Trojan.DownLoader4.61162
Fprot -
IkarusT3 -
Panda -
STOPZilla -
TrendMicro -
VBA32 -
Scan report generated by
NoVirusThanks.org
download all the project :
http://www.mediafire.com/?t9tugh14i0annwt
it got detect because we used allot of keys and the av think that it is a keylogger
hope i helped
bets regards
illusion
