Normally, UI controls must be used on the UI thread only. If you want to use a UI object from any other thread you usually have to invoke Control.Invoke
. NotifyIcon
does not have such a method.
What's the right way to do something with a NotifyIcon
from a background thread?
For example, is the following legal? What's a legal alternative?
Task.Run(() => { notifyIcon.Visible = true; });