https://bugzilla.novell.com/show_bug.cgi?id=343952

           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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [EMAIL PROTECTED]
          Found By: ---


To reproduce, run the code.

Observed:

  System.NullReferenceException: Object reference not set to an instance of an
object
  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)
[0x00000] 
  at System.Windows.Forms.TextBoxBase.set_Lines (System.String[] value)
[0x00000] 
  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
{
    [STAThread]
    static void Main()
    {
        try
        {
            Application.Run(new DialogMessages());
        } catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }

    }
}

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;
        return;
    }
}


-- 
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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to