[Mono-bugs] [Bug 81668][Min] New - Properties on NotifyIcon are ordering sensitive

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri May 18 07:30:12 EDT 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by andyhume32 at yahoo.co.uk.


--- shadow/81668	2007-05-18 07:30:12.000000000 -0400
+++ shadow/81668.tmp.16591	2007-05-18 07:30:12.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 81668
+Product: Mono: Class Libraries
+Version: 1.2
+OS Details: XP SP2
+Status: NEW   
+Priority: Minor
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: andyhume32 at yahoo.co.uk               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Properties on NotifyIcon are ordering sensitive
+If the Visible property is set before the Icon property is set then the 
+icon is _not_ drawn in the system tray.
+Mono 1.2.4 (installer).  Tested only on Windows XP SP2, where it always 
+Code like the following works and the icon appears in the system tray.
+        m_notifyIcon = new NotifyIcon();
+        m_notifyIcon.Text = "notifyIcon1";
+        m_notifyIcon.Icon = ico;
+        m_notifyIcon.Visible = true;
+However with code like the following where one sets Visible before 
+setting the Icon property then the icon is not displayed.
+        m_notifyIcon = new NotifyIcon();
+        m_notifyIcon.Text = "notifyIcon1";
+        m_notifyIcon.Visible = true;
+        m_notifyIcon.Icon = ico;
+See bug 81667--"Crash from NotifyIcon.HideSystray on Form exit if not 
+fully configured", where repro code is attached.  Call the application 
+there with a path to an icon filename on the command-line.  As it stands 
+the icon is not displayed.  Move the "m_notifyIcon.Visible = true;" to 
+the end and the icon does then appears.
+Either ordering works on MSFT CLR v2.
+In is not valid for the user have to know what ordering of properties is 
+required.  See the Framework Design Guidelines e.g at 
+    DO allow properties to be set in any order even if this results in a 
+temporary invalid object state.

More information about the mono-bugs mailing list