Imports System.Threading
Private Dim RunFunctionThread As Thread
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim st As ThreadStart = New ThreadStart(RunThread)
RunFunctionThread = New Thread(st)
RunFunctionThread.Start()
End Sub
Private Sub Form1_UnLoad(ByVal sender As Object, ByVal e As System.EventArgs)
RunFunctionThread.Abort()
End Sub
Private Sub RunThread()
While (True)
'Run your function
Thread.Sleep(30000)
End While
End Sub