Context: I'm working with a relatively simple winforms application, written in VB.NET on the .NET 3.5 framework in Visual Studio 2010.
Issue: The FormLoad event creates two threads when the program is opened. One handles automatic update checking and the other performs a time consuming task syncing files with the internet. These threads are initialized as follows:
Dim update_check_thread As New Threading.Thread(AddressOf auto_update_check)
update_check_thread.IsBackground = True
update_check_thread.Start()
The form also uses the NotifyIcon control to draw a notification icon on the taskbar. Unfortunately, each thread started causes the application to draw an additional icon to the taskbar. Additional icons are drawn (sometimes) when any threaded function is used after the program is opened.
Is there a way to "throttle" the number of icons that the form is allowed to draw? I've tried moving the code to a background worker, however the same thing continues to happen.
Thanks in advance!