Public class form1 inherits system.windows.Forms.form
#Region "Windows Form Designer Generated Code"
Public Sub new () mybase.new ()
'This call is required for the Windows Form Designer. InitializeComponent ()
'Add any initialization after INITIALIZECOMPONENT ()
End Sub
'Form rewriting Dispose to clean up the list of components. Protected overloads overrides sub dispose (byval disposing as boolean) ing disponation kiln (Components Is Nothing) Then components.dispose () end if endiffs) End sub
'Windows Form Designer Supply Private Components as System.comPonentModel.icontainer
'Note: The following procedure is necessary to use the Windows Form Designer to modify this process using the Windows Form Designer. 'Don't modify it using the code editor. Friend WithEvents Button1 As System.Windows.Forms.Button
End Sub
#End region
Private Mthtest As Threading.Thread Private I as INTEGER Private Withevents a as test
Private Sub Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For i = 1 To 50 a = New test a.ID = i mthTest = New Threading.Thread (AddressOf a.add) mthTest .Start () Next End Subprivate Sub K () Handles a.finish system.gc.collect () End Subend Class
Public Class Test Private Mint AS INTEGER
Public event finish ()
Public property ID () AS Integer Get Return Mint end set (byval value as integer) mint = value end vendy
Public Sub Add () DIM I as INTEGER for i = 0 to 100 Debug.Writeline ("This is the" & MintiD & "thread, running:" & i 1) Next RaiseEvent Finish () End Subend Class