threading problem

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.
 
P

Patrice

A

Armin Zingler

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))
 
F

friend

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
 
A

Armin Zingler

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top