Hello Kiddies At MPGH Today I show you how to
make a simple crosshair in Visual Basics 2008 - 10
[VB2008-10] CrossFire Crosshair
☻So First: Start Up Your Visual Basics ,
☻Click Create New Form Application,
☻Rename It Anything You Want,
☻Build It By Framework.NET 2.0,
,
☻You Need: 2 Forms Name The Second Crosshair.vb,
☻For crosshair.vb make its Size 50,50 Of by
the properties, Then Change The Background
Colour but not to green then got to the bottom of
Properties and change the transparent key to the same
colour,
☻Change The Border Style Of crosshair.vb To None,
☻In Form1.vb Add A Time, Enable it True By The Properties,
Double Click On Your Form1 Border Design And Add This Code After
The Public Class Form 1:
Code:
Private Property result As Short
Private Declare Function GetAsyncKeyState Lib "User32" (ByVal vKey As Integer) As Short
We Need This Code For The Hot-keys To Work And Be Recognized,
☻After That Double Click The Timer And Add The Following:
Code:
For i = 6 To 255
result = 0
result = GetAsyncKeyState(i)
If GetAsyncKeyState(Keys.F1) Then
crosshair.Show()
End If
If GetAsyncKeyState(Keys.F2) Then
crosshair.Hide()
End If
Next i
here we use F1 to show up our crosshair and F2 to hide it!
and the (i) / Next i ,.. loop is very important for the hot-keys
because we like that it work for all Operating-systems,
☻Now Go on crossfire.vb and go to the Properties And Go To
Top Most At The Bottom Enable That True Then Go Near The
Top And Make Enable True,
☻Go On Properties Go To The Bottom And Change the
StartPosition To The CenterScreen So You Turn It On
And Of In Game So It Fits Screen Size
☻Keep On crossfire.vb double click it and Replace the
crosshair_Load and that with this:
Code:
Private Sub Crosshair_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim greenPen As New Drawing.Pen(Color.Green, 1)
e.Graphics.DrawLine(greenPen, 25, 0, 25, 50)
e.Graphics.DrawLine(greenPen, 0, 25, 50, 25)
End Sub
Your Codes Should Be Like This:
Form1.vb Code:
Code For crosshair.vb:
If All Done Click F5 And Debug It
If You Think The Crosshair is to big Then:
☻remove this code from the crosshair.vb and
change the size to 25,25,
☻Then Go to Tools And Scroll Down To Visual Basic Power
Pack And Draw Your Own,
☻Make Sure You Leave The StartPosition.
Heres Mine:
Click Thanks And KEEP MPGH Alive Hehe