Keno
Member
- Mar 12, 2012
- 70
- 17
Hi cutie pies this section looks dead and I'm bored so here's how to make a basic 'auto typer'.
Before we continue I'd suggest reading these:
Once you've done that view the form's code and let's add a few lines of code to the constructor to initialise some values.
Go back to the design in find your timer double click it and add this code!!!!
Go back to the design, double click your send button and let's add some code woo!!!
Woah!!1!one!! you've done it now you have an auto typer ^^, now go mess around with it haha. If I made an error srry wrote it in notepad but it looks ok.
Any tutorial requests? Advanced/basic Java & C# only pls if I'm bored I'll write one up ;*
Before we continue I'd suggest reading these:
Start a new project in Visual Studio using WFA and add a text box, timer, combo box and a button then name them whatever you want and add suitable text!!SendKeys Class:You must be registered for see links
try-catch :You must be registered for see links
Once you've done that view the form's code and let's add a few lines of code to the constructor to initialise some values.
Code:
public Form1() {
...
button1.Text = "Start";
comboBox1.Text = "500";
comboBox1.Items.AddRange(new object[] { "1000", "1500", "2000", "2500", "3000", "3500", }); //Adds these values to the cbox
... }
Code:
private void timer1_Tick(object sender, EventArgs e) {
SendKeys.Send(textBox1.Text); // Please read the SendKeys class reference I provided above if you have not :@
SendKeys.Send("{ENTER}");
}
Code:
private void button1_Click(object sender, EventArgs e)
{
try
{
if (button1.Text == "Start")
{
timer1.Interval = Int32.Parse(comboBox1.Text);
button1.Text = "Stop";
timer1.Start();
}
else
{
button1.Text = "Start";
timer1.Stop();
}
}
catch (Exception ex) {
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Any tutorial requests? Advanced/basic Java & C# only pls if I'm bored I'll write one up ;*
Last edited: