All pastes #764158 Raw Edit

Untitled

public text v1 · immutable
·published 2007-11-06 23:57 UTC
rendered paste body
Public Class Form1

    Private myThread As Threading.Thread

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
           Dim testclass As New AutomatedTask
            myThread = New Threading.Thread(AddressOf testclass.Begin)
            myThread.Start()
    End Sub
End Class



Public Class AutomatedTask
    Public Sub New()

    End Sub

    Public Sub Begin()
       dim i as integer
 
       for i=0 to 500

       next

        'Long task
        Threading.Thread.Sleep(100000)
        MsgBox("Task complete!")
    End Sub
End Class