Cross thread exception drive me mad!!!!!
hello all
we develop an application with 11 screens (charts), now the data loading for each screen is very slow. so i wanted to run the active screen by the current thread and the 10 other screens by 10 (or less) threads, but, i can't do this because of the cross thread ilegal exception.
now is there anyway of doing this????
is there a command similar to invoke later in java???? (i do not like this option but if there is no other way so...)
by the way i am working with v.s 2005 C# 2.0, is there a new objects that can do what i need???
what is the worker thread for????
itzik
Mike GoldPosted Aug 10, 2006, 4:37 PM
best,
-Mike
Milad AzimiPosted Aug 7, 2006, 3:50 PM
steven lopezPosted Apr 4, 2006, 1:58 PM
You can use the background worker to get your database information. It has a worker completed event in which you use to update your User Interface. You cannot update your User Interface from a different thread directly. Also if you Double buffer your forms this should improve performance. I have done this on an application i have written. You also have to be aware of .net cold startup and warm startup. You will see a noticable difference in application startup time the second time the application starts up cause the .net dll's your application uses are already loaded into base address. Refer to Microsoft patterns and pratices for more information on cold startups there are ways to improve it.