Simple alternating text in Visual Basic 2008

Posted by Josh Grate on Programmers See other posts from Programmers or by Josh Grate
Published on 2013-10-24T19:55:31Z Indexed on 2013/10/24 22:07 UTC
Read the original article Hit count: 279

Filed under:

I have a simple completed program, but i would like to add one more feature to it but I'm not sure how. I have it set up to send a message automatically every 7 seconds when a text field is selected, repeating the message of course. What I would like for it to do is alternate between two separate messages, instead just repeating the one. I would like the new program to post at an interval of 12 seconds. Can you help me? Here is my coding.

Public Class Form1

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 
SendKeys.Send(TextBox1.Text) 
SendKeys.Send("{ENTER}") 
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 
Timer1.Enabled = True 
Timer1.Interval = (TextBox2.Text) 
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 
Timer1.Enabled = False 
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
Timer1.Enabled = False 
End Sub 
End Class

© Programmers or respective owner

Related posts about visual-basic