Dear all,
I am trying to code with visual basic 2010.
I have 2 button START and STOP . if start button pressed while loop should executed with printing "hello" first time and "welcome"in second time . This loop should executed evey 5s. If stop button pressed while loop should end print " stop button pressed on same rich textbox
Code:Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_click.Click Timer1.Interval = 1000 '3 seconds Timer1.Enabled = True RichTextBox1.Text = "hello" RichTextBox1.Text = "\n wait\n" End Sub Private Sub Button_stop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_stop.Click Timer1.Enabled = False RichTextBox1.Text = "Button stop pressed" End Sub End Class




Reply With Quote
