Consider this WinForms program:
Module Main
Dim notifyicon As New System.Windows.Forms.NotifyIcon
'Dim dummycontrol As New System.Windows.Forms.Control
Public Sub Main()
If (System.Threading.SynchronizationContext.Current Is Nothing) Then
MessageBox.Show("Nothing")
Else
MessageBox.Show("Something")
End If
End Sub
End Module
NotifyIcon is a WinForm control, and requires a message loop, so why will declaring dummycontrol
(or any WinForms control) set a SynchronizationContext, but the NotifyIcon does not?
NotifyIcon
doesn't inherit fromSystem.Windows.Forms.Control
- does that change the premise of your question? – Quern