I wanted to know how I can get the program to type itself, it's like sending a message with sendkeys but it goes letter by letter like a human typing.
I had done the usual way to send a message, but I need to be sent slowly and I could not:
Dim F1 As Boolean
F1 = GetAsyncKeyState(Keys.F1)
Select Case F1
Case F1
If F1 And MetroComboBox1.Text = "F1" = True Then
Clipboard.SetDataObject(MetroTextBox1.Text)
SendKeys.Send("{ENTER}")
SendKeys.Send("^v{ENTER}")
ElseIf F1 And MetroComboBox2.Text = "F1" = True Then
Clipboard.SetDataObject(MetroTextBox2.Text)
SendKeys.Send("{ENTER}")
SendKeys.Send("^v{ENTER}")
ElseIf F1 And MetroComboBox3.Text = "F1" = True Then
Clipboard.SetDataObject(MetroTextBox3.Text)
SendKeys.Send("{ENTER}")
SendKeys.Send("^v{ENTER}")
ElseIf F1 And MetroComboBox4.Text = "F1" = True Then
Clipboard.SetDataObject(MetroTextBox4.Text)
SendKeys.Send("{ENTER}")
SendKeys.Send("^v{ENTER}")
End If
End Select
I wanted to know how I can send textbox1 messages slowly, letter by letter
I also tried to deploy this code in my project but I did not succeed, it basically does the effect I want but at a lower speed and in a program label:
Public Class Form2
Dim i As Integer = -1
Dim mensagem As String
Private Sub ExibirMensagem(ByVal msg As String)
Timer1.Stop()
i = -1
Label1.Text = Nothing
mensagem = msg
Timer1.Start()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim tamanho As Integer = mensagem.Length
i = i + 1
If i = tamanho Then
Timer1.Stop()
i = -1
Else
Label1.Text = Label1.Text & mensagem.Chars(i)
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
ExibirMensagem(TextBox1.Text)
End Sub
End Class