threading problem

  • Thread starter Thread starter friend
  • Start date Start date
F

friend

Hi all,

I am trying to implement multithreading in myproject.
I have created a thread say thread1, and i am running a splashscreen
in that thread.

Public thread1 As Thread
thread1 = New Thread(AddressOf BackgroundWork)
thread1.Start()

Public Sub BackgroundWork()
SplashScreen1.ShowDialog()
End Sub

I have to kill this thread at one point in my program. I am using
thread1.abort(), but the splashscreen1 doesnt go from the vision. If i
move the mouse pointer or other the splashscreen disappears.

The splashscreen should disappear as soon as the thread is killed. How
to solve this issue.

Thank you for any suggestion.
 
friend said:
Hi all,

I am trying to implement multithreading in myproject.
I have created a thread say thread1, and i am running a splashscreen
in that thread.

Public thread1 As Thread
thread1 = New Thread(AddressOf BackgroundWork)
thread1.Start()

Public Sub BackgroundWork()
SplashScreen1.ShowDialog()
End Sub

I have to kill this thread at one point in my program. I am using
thread1.abort(), but the splashscreen1 doesnt go from the vision. If i
move the mouse pointer or other the splashscreen disappears.

The splashscreen should disappear as soon as the thread is killed. How
to solve this issue.

Thank you for any suggestion.

I agree with Patrice that Abort should not be called.
If you don't want to use the Application Framework, just close the Form
from the thread that created the Form by invoking the close method:

SplashScreen1.Invoke(New MethodInvoker(AddressOf SplashScreen1.Close))
 
friend schrieb:










I agree with Patrice that Abort should not be called.
If you don't want to use the Application Framework, just close the Form
from the thread that created the Form by invoking the close method:

 SplashScreen1.Invoke(New MethodInvoker(AddressOf SplashScreen1.Close))

so what could be other way to stop the other thread (in which
splashscreen is running)

Thanks to all
 
friend said:
so what could be other way to stop the other thread (in which
splashscreen is running)

Close the Form from the thread that created the Form by invoking the
close method.
 
Back
Top