|
-
Mar 29th, 2007, 04:56 PM
#1
Thread Starter
New Member
[2005] Listbox will not add item using system.timers
Hi,
My current code is as follows: http://www.nomorepasting.com/paste.php?pasteID=76375
The initial calls to ConsoleWrite work perfectly, the lines are added and all is well. However the timers, when they call ConsoleWrite(), do not write anything to the listbox on the form. I debugged it and the steps seem to go upto the calls to ConsoleWrite(), then step into the subroutine, but after that, do not do anything.. the timer.enabled property is not restored to true and everything stops. I'm guessing this has something to do with the fact these timer threads are calling ConsoleWrite() and not the main UI thread.. but im not sure why.
On line 29, I have simply attempted to see whether manually adding an item will change result, but this didn't work.
I also tried adding the lines GC.keepalive() for each timer in form_load, as I thought it might be the garbage collection messing with the timer after it finished.
Thanks,
Andy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|