Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[vb] move items/hot keys + [project]

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
Code
If e.KeyCode = Keys.s Then Button1.Left += 1
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 :
Code
If Button1.Location = Button2.Location Then
beep()
End If

lets 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 end
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) :
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 If
done ? button code :
Code
If Button1.Location = Button7.Location Then
Label1.Text += 500
End If
Button1.Focus()
timer1 code :
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
Next
form load code :
Code
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


all 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 Class

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
(Jul 16, 2012 11:15 AM)MiniDomix Wrote:  Thank you guy, this code is verry good for all my project ^^

no problem mate , glad that i helped you ;)
Just curious, but is your space bar broken?


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Dyst0piaSep 8, 2015 04:45 AM 6 161 Sep 8, 2015 04:45 AM
Last Post: Dyst0pia
[.NET] by Cody8295Jan 20, 2013 07:38 PM 88 2,562 Jan 20, 2013 07:38 PM
Last Post: Cody8295
[.NET] by *****Jun 27, 2012 01:28 PM 19 655 Jun 27, 2012 01:28 PM
Last Post: SIM-747559