[Mono-bugs] [Bug 64428][Blo] New - Setting the Text property causes a null object exception

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 28 Aug 2004 14:34:57 -0400 (EDT)


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 gluca@pivato.com.

http://bugzilla.ximian.com/show_bug.cgi?id=64428

--- shadow/64428	2004-08-28 14:34:57.000000000 -0400
+++ shadow/64428.tmp.31333	2004-08-28 14:34:57.000000000 -0400
@@ -0,0 +1,71 @@
+Bug#: 64428
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: Red Hat 9
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: Windows.Forms
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gluca@pivato.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Setting the Text property causes a null object exception
+
+Description of Problem:
+
+I tried very simple test app and set the Text property in
+InizializeComponent, called by the form constructor. This causes a null
+object exception. The same executable compiled with mono runs well on Windows.
+
+I'm using the latest mono build and assemblies 1.0.1-1. Just checked with
+gacutil.
+
+Steps to reproduce the problem:
+
+using System;
+using System.Windows.Forms;
+
+public class Test : Form
+{
+	private Button btn1;
+	private Button btn2;
+
+	public Test()
+	{
+		InitializeComponent();
+	}
+
+	private void InitializeComponent()
+	{
+		this.btn1 = new Button();
+		this.btn2 = new Button();
+		this.btn1.Name = "Test1";
+		this.btn2.Name = "Test2";
+		this.btn1.Text = "Pushme";  <===== Exception
+		this.btn1.Dock = DockStyle.Top;
+		this.btn2.Dock = DockStyle.Bottom;
+		this.Controls.Add(btn1);
+		this.Controls.Add(btn2);
+	}
+
+	public static void Main()
+	{
+		Application.Run(new Test());
+	}
+}
+
+Actual Results:
+null object Exception
+
+Expected Results:
+
+
+How often does this happen? 
+Always
+
+Additional Information: