when stooping my program, the program continues to run, its a threading problem , i dont know what to do , this is how the program looks like >>

public sub main

StartSocketThread()
dim a as new form1
dim b as new form2
a.show
application.run(b)
a.close


end sub


public sub StartSocketThread()
dim thread as new thread ( addressof start)
thread.isbackground=true
thread.start
end sub


public sub start()

'some code

' the problem is here, the loop is to keep the thread alive, but dont know how to close it ( i thought it would work when set to background thread )
do
loop

end sub