﻿

Public Class Form2












    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        loaded = False

        Dim testthread As New System.Threading.Thread(AddressOf Module1.navigate)
        site1 = "www.yahoo.com"
        Debug.Print(Form1.WebBrowser1.Url.ToString)
        'this shows www.google.com
        testthread.Start()

        'System.Windows.Forms.Application.DoEvents()

        Debug.Print(Form1.WebBrowser1.Url.ToString)
        'this shows www.google.com



        site1 = "www.yahoo.com"
        Debug.Print(Form1.WebBrowser1.Url.ToString)


        Debug.Print(Form1.WebBrowser1.Url.ToString)
    
        Debug.Print(loaded.ToString)



        Debug.Print(Form1.WebBrowser1.Url.ToString)

      

    End Sub

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Call Module1.loop2()

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Call Module1.loop1()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim testthread As New System.Threading.Thread(AddressOf Module1.loop1)
        testthread.Start()
        System.Threading.Thread.Sleep(1000)
        Call Module1.loop2()

    End Sub



    Public Sub loop11()
        Dim y As Long

        For y = 1 To 1000
            Label2.Text = y
            System.Threading.Thread.Sleep(2)
            Label2.Refresh()

        Next
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim testthread As New System.Threading.Thread(AddressOf Module1.loop3)
        Dim testthread1 As New System.Threading.Thread(AddressOf Module1.loop3)
        Dim testthread2 As New System.Threading.Thread(AddressOf Module1.loop3)
        Dim testthread3 As New System.Threading.Thread(AddressOf Module1.loop3)
        Dim testthread4 As New System.Threading.Thread(AddressOf Module1.loop3)
        testthread.Start(1)
        System.Threading.Thread.Sleep(20000)

        testthread1.Start(2)
        System.Threading.Thread.Sleep(20000)
        testthread2.Start(3)
        System.Threading.Thread.Sleep(20000)
        testthread3.Start(4)
        System.Threading.Thread.Sleep(20000)
        testthread4.Start()
        System.Threading.Thread.Sleep(20000)
        Call Module1.loop3(6)

    End Sub






    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Call Module1.loop3(1)

    End Sub
End Class




