Problem in thread.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • priyamtheone
    New Member
    • Sep 2007
    • 88

    #1

    Problem in thread.

    Is there any way possible in a windows application
    project to kill the default current thread of the project
    and run a new thread and then relate the project to
    it?

    My case scenario:-
    I have a startup form. In its Load event I want to kill
    the current thread, create a new thread and run the
    project through the new thread. This'll be applicable
    in closing the startup form and open another form.
    When I run, the new thread is being created,
    everything is ok. But as soon as the default/current
    thread is being killed the application is closing down.
    How can I tackle this? Provided, I don't want to hide
    the startup form or stuffs like that.
    Plz help. Regards.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Don't kill the thread that loads forms at all. Why do you need this new thread? All interface drawing should be done on one thread anyway so even if you start a new thread you still need to make sure all your GUI painting is happening on the GUI thread. Google for "C# Threading with BackgroundWorke r" for more details.

    Comment

    Working...