Updating listbox using a thread in answers in genesis radiometric dating

Rated 3.82/5 based on 941 customer reviews

Following code in the below shows how i used a delegate to do that task, but it blocks the GUI form.so i just want to convert it to an asynchronous delegate which updates list box without blocking the GUI Form delegate declaration I have included your coding in a button click event.Thi thread checks if a Invoke is necessary and then uses Invoke if it is necessary.which are required to marshall the call from a background thread to a main UI thread.In my code I have to call listbox.items.refresh to have the screen reflect my changes.

Threading; namespace Remote Monitor Server Now, when I start this code, the listbox does get "Programm started! There is no error in Visual Studio 2010, can someone please tell me what I'm doing wrong here?

It will invoke Method To Do Work successully and once it tries to update the listbox inside the Method To Update Control, it will generate an exception by saying "Target Invocation Exception was unhandled" at Application.

Run(new Form Main()); in If you are modifying a UI element, then you are going to HAVE to block the UI thread. You use the Background Worker to get the Data that populate the List Box.

I'm a programming student, but everyone at my school has a dislike of C#.

I like your longer explanation since it's helping me to understand what's going on.

Leave a Reply