hi all

on my start button ive got it running a sub in a new thread

VB Code:
  1. Dim t As New Thread(AddressOf ObjSearch.PrimaryYellSearch)
  2.                 t.Name = "YellPrimarySearch"
  3.                 t.IsBackground = True
  4.                 t.Start()

ive got another button which is my plause/resume button but how do i plause/sleep the thread when its been clicked????

VB Code:
  1. Dim t As Thread
  2.         Try
  3.  
  4.             If Me.btnManage.Text = "Plause" Then
  5.                 Me.btnManage.Text = "Resume"
  6.                 t.Sleep(True)
  7.                 Me.btnManage.Update()
  8.             Else
  9.                 Me.btnManage.Text = "Plause"
  10.                 t.Sleep(False)
  11.                 Me.btnManage.Update()
  12.             End If
  13.  
  14.         Catch ex As Exception
  15.             MsgBox(ex.ToString, MsgBoxStyle.Critical, "Application Error")
  16.         End Try