Context:
I work with a relatively simple winforms application written in VB.NET on the .NET 3.5 platform in Visual Studio 2010.
Question:
The FormLoad event creates two threads when the program opens. One handles automatic update checking, and the other takes a long time to sync files to 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 running thread causes the application to draw an additional icon on the taskbar. Additional icons are drawn (sometimes) when any threaded function is used after opening a program.
Is there a way to "throttle" the number of icons that forms are allowed to draw? I tried moving the code to a background worker, however the same thing continues to happen.
Thanks in advance!
source
share