c# - Main Form got hang during long running process in different thread. -


i'm using threading in windows form application.

code

thread sqlprocessthread = new thread(new threadstart(dosqlwork)); sqlprocessthread.isbackground = true;   sqlprocessthread.start(); 

when ever thread called form @ time form got hang. how can solve problem out using background worker.

you can use property invokerequired check ui acess different thread.

        if (this.invokerequired)         {             this.invoke(new methodinvoker(this.updateui));             return;         } 

more information: msdn documentation


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -