![]() |
|
[TUT] AutoTyper - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework) +--- Thread: [TUT] AutoTyper (/Thread-TUT-AutoTyper) |
[TUT] AutoTyper - TeraByTe - 06-21-2011 AutoTyper Tutorial
Ok today guys im gonna show you how to create a simple autotyper. Its one of the easiest projects you will make but you need to remember all the little things that make little projects professional. Step1 You need to create a form. Heres a list of what you need;
Step2 Double click your start button and add this code; Code: Timer1.interval = TextBox7.Text
Timer1.Start()
Button2.Enabled = True
Button1.Enabled = FalseStep3 Double click you stop button and add this code; Code: Timer1.Stop()
Button2.Enabled = False
Button1.Enabled = TrueStep4 In the properties panel of your stop button, set enabled to false. This will stop us from clicking stop when there is nothing to stop. Step5 Double click on Timer1 and add this code; Code: If CheckBox1.Checked = True Then
On Error Resume Next
SendKeys.Send(TextBox1.Text)
On Error Resume Next
SendKeys.Send("{Enter}")
End If
If CheckBox2.Checked = True Then
On Error Resume Next
SendKeys.Send(TextBox2.Text)
On Error Resume Next
SendKeys.Send("{Enter}")
End If
If CheckBox3.Checked = True Then
On Error Resume Next
SendKeys.Send(TextBox3.Text)
On Error Resume Next
SendKeys.Send("{Enter}")
End If
If CheckBox4.Checked = True Then
On Error Resume Next
SendKeys.Send(TextBox4.Text)
On Error Resume Next
SendKeys.Send("{Enter}")
End If
If CheckBox5.Checked = True Then
On Error Resume Next
SendKeys.Send(TextBox5.Text)
On Error Resume Next
SendKeys.Send("{Enter}")
End If(Note: You may need to change the name of the textbox codes depending on how you have laid out your form. Just make sure that checkbox1 and textbox1 are together, checkbox2 and textbox2 are together etc. This will stop confusion later.) Step6 Test your program with Visual Studios inbuilt Debugging feature. Step7 If it works, build the appplication then test it outside of Visual Studio Step8 If it didnt work, then check your code against my full source code below. Full Source Code Code: Public Class Form1
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.interval = TextBox7.Text
Timer1.Start()
Button2.Enabled = True
Button1.Enabled = False
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
Button2.Enabled = False
Button1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If CheckBox1.Checked = True Then
On Error Resume Next
SendKeys.Send(TextBox1.Text)
On Error Resume Next
SendKeys.Send("{Enter}")
End If
If CheckBox2.Checked = True Then
On Error Resume Next
SendKeys.Send(TextBox2.Text)
On Error Resume Next
SendKeys.Send("{Enter}")
End If
If CheckBox3.Checked = True Then
On Error Resume Next
SendKeys.Send(TextBox3.Text)
On Error Resume Next
SendKeys.Send("{Enter}")
End If
If CheckBox4.Checked = True Then
On Error Resume Next
SendKeys.Send(TextBox4.Text)
On Error Resume Next
SendKeys.Send("{Enter}")
End If
If CheckBox5.Checked = True Then
On Error Resume Next
SendKeys.Send(TextBox5.Text)
On Error Resume Next
SendKeys.Send("{Enter}")
End If
End Sub
End ClassThats it. Hope that was easy enough for you. Let me know if your struggling
RE: [TUT] AutoTyper - nickjonnes - 06-22-2011 ncie work this is a really good introduction into the send key functions which for some reason so many noobs have issues with. thansk again
RE: [TUT] AutoTyper - WoosTy - 06-22-2011 nice work man, thanks...
|