[Mono-bugs] [Bug 343952] New: TextBox: NRE setting Lines property

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Nov 26 04:46:10 EST 2007


           Summary: TextBox: NRE setting Lines property
           Product: Mono: Class Libraries
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: kobruleht2 at hot.ee
         QAContact: mono-bugs at ximian.com
          Found By: ---

To reproduce, run the code.


  System.NullReferenceException: Object reference not set to an instance of an
  at System.Windows.Forms.Document.RecalculateDocument (System.Drawing.Graphics
g, Int32 start, Int32 end, Boolean optimize) [0x00000] 
  at System.Windows.Forms.Document.ResumeRecalc (Boolean immediate_update)
  at System.Windows.Forms.TextBoxBase.set_Lines (System.String[] value)
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.TextBoxBase:set_Lines (string[])
  at DialogMessages..ctor () [0x00000] 
  at (wrapper remoting-invoke-with-check) DialogMessages:.ctor ()
  at Test.Main () [0x00000] 

Code to reproduce:

using System;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
using System.Collections;

public class Test
    static void Main()
            Application.Run(new DialogMessages());
        } catch (Exception ex)


public class DialogMessages : Form {
    private TextBox tbMessages = new TextBox();

    public DialogMessages()    {
        IList msgs = new string[1];
        msgs[0] = "";

        string[] lines = new string[msgs.Count];
        int l = 0;
        foreach (string msg in msgs)  {
            lines[l++] = msg;
        tbMessages.Lines = lines;

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list