Hello,
I'm using threads to fill a form with multiple controls: In a
listbox.selecteditem_changed, I abort the current thread, and I start a
new thread to fill the form with the data correspondent to the selected
Item. The reason for using threads here is speed (since the filling of
the form takes +/- 0.5 sec). But if I rapidly select some different
items in the listbox (e.g. with the arrow buttons), the application
stops executing, and crashes (CPU-time=100% and not responding). There
doesn't seem to be a critical line of code, it just stops at different
lines... Does anyone knows what the reason is for this ? Here's the code:
private sub lst_selectedindexchanged(...) handles ...
try
thread.abort 'thread is declared private in
'the form class
catch exc as exception
end try
thread=new threading.thread(AddressOf fillForm)
thread.start()
end sub
private sub FillForm()
'here i do stuff like: filling a Combobox,
'setting text for a textbox, ...
end sub
Thanks,
Snuyt