Greetings.
I have a program in VB2008 and I need to execute a thread from differents Subs.
Each time I start the thread I want to cancel the previous.
Here an example:
I write in a textbox, TextBox_Changed fires, thread spend 4 minutes filling a dataset
I check a checkbox, ckBoxAllRecords _CheckedChanged fires, thread spend 10 seconds filling a dataset.
I dont want anymore the dataset of TextBox_Changed so I want to cancel its filling.
It is possible to do?
Thanks in advance for any reply
I have a program in VB2008 and I need to execute a thread from differents Subs.
Each time I start the thread I want to cancel the previous.
Here an example:
Code:
Private Sub TextBox_Changed(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim ThreadResults As New Thread(AddressOf ShowResults)
ThreadResults.Start()
End Sub
Private Sub ckBoxAllRecords_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ThreadResults As New Thread(AddressOf ShowResults)
ThreadResults.Start()
End Sub
I check a checkbox, ckBoxAllRecords _CheckedChanged fires, thread spend 10 seconds filling a dataset.
I dont want anymore the dataset of TextBox_Changed so I want to cancel its filling.
It is possible to do?
Thanks in advance for any reply
Comment