[Mono-winforms-list] Problem with MWF

Peter Dennis Bartok peter at novonyx.com
Fri Jul 1 12:03:39 EDT 2005


Having the code that causes this would surely help. Or at least some details 
what the code puts in / what keys you pressed in the textbox.

Peter

-----Original Message-----
From: "Paul" <paul at all-the-johnsons.co.uk>
To: "winforms" <mono-winforms-list at lists.ximian.com>
Date: 01 July, 2005 04:01
Subject: [Mono-winforms-list] Problem with MWF


Hi,

I've just recompiled mwf using the preview option and a piece of
software which normally runs is causing a bit of a problem - looks like
something has broken somewhere.

The throwback is this

Mono System.Windows.Forms Assembly [Revision: 44786; built: 2005/5/25
22:34:45]
Keyboard: British keyboard layout
TextControl.cs(969) Invalidate called in UpdateView(line, pos)
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument
TextBox.cs(1175) Invalidate called in CalculateDocument

Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object
in <0x0003f> System.Windows.Forms.Document:PositionCaret
(System.Windows.Forms.Line line, Int32 pos)
in <0x00314> System.Windows.Forms.TextBoxBase:set_Text (System.String
value)
in <0x0000d> System.Windows.Forms.TextBox:set_Text (System.String value)
in <0x00017> System.Windows.Forms.NumericUpDown:set_Text (System.String
value)
in <0x000e0> System.Windows.Forms.NumericUpDown:UpdateEditText ()
in <0x0046d> System.Windows.Forms.UpDownBase:.ctor ()
in <0x00010> System.Windows.Forms.NumericUpDown:.ctor ()
in (wrapper remoting-invoke-with-check)
System.Windows.Forms.NumericUpDown:.ctor ()
in <0x005bd> System.Windows.Forms.MonthCalendar:.ctor ()
in <0x00010> System.Windows.Forms.MonthCalendar:.ctor
(System.Windows.Forms.DateTimePicker owner)
in (wrapper remoting-invoke-with-check)
System.Windows.Forms.MonthCalendar:.ctor
(System.Windows.Forms.DateTimePicker)
in <0x00034> System.Windows.Forms.DateTimePicker:.ctor ()
in (wrapper remoting-invoke-with-check)
System.Windows.Forms.DateTimePicker:.ctor ()
in <0x00398> WindowsApplication1.Form1:InitialiseComponent ()
in <0x00013> WindowsApplication1.Form1:.ctor ()
in (wrapper remoting-invoke-with-check) WindowsApplication1.Form1:.ctor
()
in <0x0001a> WindowsApplication1.Form1:Main ()

The problem is not the source, but mwf.

Any ideas what the problem is or where it is hiccuping?

TTFN

Paul

Source :

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

namespace WindowsApplication1
{
  public class Form1:System.Windows.Forms.Form
  {
    private System.Windows.Forms.GroupBox groupBox1;
    private System.Windows.Forms.RadioButton radioButton1;
    private System.Windows.Forms.RadioButton radioButton2;
    private System.Windows.Forms.RadioButton radioButton3;
    private System.Windows.Forms.CheckBox checkBox1;
    private System.Windows.Forms.CheckBox checkBox2;
    private System.Windows.Forms.CheckBox checkBox3;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.Button button2;
    private System.Windows.Forms.ProgressBar progressBar1;
    private System.Windows.Forms.TabControl tabControl1;
    private System.Windows.Forms.TabPage tabPage1;
    private System.Windows.Forms.TabPage tabPage2;
    private System.Windows.Forms.ListView listView1;
    private System.Windows.Forms.DateTimePicker dateTimePicker1;
    private System.Windows.Forms.TrackBar trackBar1;
    private System.Windows.Forms.HScrollBar hScrollBar1;
    private System.Windows.Forms.VScrollBar vScrollBar1;
    private System.Windows.Forms.ColumnHeader columnHeader1;
    private System.Windows.Forms.ColumnHeader columnHeader2;
    private System.ComponentModel.Container components = null;

    public Form1()
    {
      InitialiseComponent();
    }

    protected override void Dispose(bool disposing)
    {
      if (disposing)
      {
if (components != null)
{
  components.Dispose();
}
      }
      base.Dispose(disposing);
    }

    #region Windows Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>

    private void InitialiseComponent()
    {
      this.groupBox1 = new System.Windows.Forms.GroupBox();
      this.button2 = new System.Windows.Forms.Button();
      this.button1 = new System.Windows.Forms.Button();
      this.checkBox3 = new System.Windows.Forms.CheckBox();
      this.checkBox2 = new System.Windows.Forms.CheckBox();
      this.checkBox1 = new System.Windows.Forms.CheckBox();
      this.radioButton3 = new System.Windows.Forms.RadioButton();
      this.radioButton2 = new System.Windows.Forms.RadioButton();
      this.radioButton1 = new System.Windows.Forms.RadioButton();
      this.tabControl1 = new System.Windows.Forms.TabControl();
      this.progressBar1 = new System.Windows.Forms.ProgressBar();
      this.tabPage1 = new System.Windows.Forms.TabPage();
      this.listView1 = new System.Windows.Forms.ListView();
      this.tabPage2 = new System.Windows.Forms.TabPage();
      this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
      this.hScrollBar1 = new System.Windows.Forms.HScrollBar();
      this.trackBar1 = new System.Windows.Forms.TrackBar();
      this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
      this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
      this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
      this.groupBox1.SuspendLayout();
      this.tabControl1.SuspendLayout();
      this.tabPage1.SuspendLayout();
      this.tabPage2.SuspendLayout();

((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
      this.SuspendLayout();
      //
      // groupBox1
      //
      this.groupBox1.Controls.AddRange(new
System.Windows.Forms.Control[] {
this.button2, this.button1, this.checkBox3, this.checkBox2,
this.checkBox1, this.radioButton3, this.radioButton2,
this.radioButton1});
      this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
      this.groupBox1.Location = new System.Drawing.Point(8, 8);
      this.groupBox1.Name = "groupBox1";
      this.groupBox1.Size = new System.Drawing.Size(336, 104);
      this.groupBox1.TabIndex = 0;
      this.groupBox1.TabStop = false;
      this.groupBox1.Text = "groupBox1";
      //
      // button2
      //
      this.button2.FlatStyle = System.Windows.Forms.FlatStyle.System;
      this.button2.Location = new System.Drawing.Point(168, 72);
      this.button2.Name = "button2";
      this.button2.TabIndex = 7;
      this.button2.Text = "button2";
      //
      // button 1
      //
      this.button1.FlatStyle = System.Windows.Forms.FlatStyle.System;
      this.button1.Location = new System.Drawing.Point(248, 72);
      this.button1.Name = "button1";
      this.button1.TabIndex = 6;
      this.button1.Text = "button1";
      //
      // checkbox3
      //
      this.checkBox3.FlatStyle = System.Windows.Forms.FlatStyle.System;
      this.checkBox3.Location = new System.Drawing.Point(216, 40);
      this.checkBox3.Name = "checkBox3";
      this.checkBox3.TabIndex = 5;
      this.checkBox3.Text = "checkBox3";
      //
      // checkbox2
      //
      this.checkBox2.FlatStyle = System.Windows.Forms.FlatStyle.System;
      this.checkBox2.Location = new System.Drawing.Point(112, 40);
      this.checkBox2.Name = "checkBox2";
      this.checkBox2.TabIndex = 4;
      this.checkBox2.Text = "checkBox2";
      //
      // checkbox1
      //
      this.checkBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
      this.checkBox1.Location = new System.Drawing.Point(8, 40);
      this.checkBox1.Name = "checkBox1";
      this.checkBox1.TabIndex = 3;
      this.checkBox1.Text = "checkBox1";
      //
      // radioButton3
      //
      this.radioButton3.FlatStyle =
System.Windows.Forms.FlatStyle.System;
      this.radioButton3.Location = new System.Drawing.Point(216, 16);
      this.radioButton3.Name = "radioButton3";
      this.radioButton3.TabIndex = 2;
      this.radioButton3.Text = "radioButton3";
      //
      // radioButton2
      //
      this.radioButton2.FlatStyle =
System.Windows.Forms.FlatStyle.System;
      this.radioButton2.Location = new System.Drawing.Point(112, 16);
      this.radioButton2.Name = "radioButton2";
      this.radioButton2.TabIndex = 1;
      this.radioButton2.Text = "radioButton2";
      //
      // radioButton1
      //
      this.radioButton1.FlatStyle =
System.Windows.Forms.FlatStyle.System;
      this.radioButton1.Location = new System.Drawing.Point(8, 16);
      this.radioButton1.Name = "radioButton1";
      this.radioButton1.TabIndex = 0;
      this.radioButton1.Text = "radioButton1";
      //
      // progressBar1
      //
      this.progressBar1.Location = new System.Drawing.Point(8, 120);
      this.progressBar1.Name = "progressBar1";
      this.progressBar1.Size = new System.Drawing.Size(336, 23);
      this.progressBar1.TabIndex = 1;
      //
      // tabControl1
      //
      this.tabControl1.Controls.AddRange(
new System.Windows.Forms.Control[] {
   this.tabPage1, this.tabPage2 });
      this.tabControl1.Location = new System.Drawing.Point(8, 152);
      this.tabControl1.Name = "tabControl1";
      this.tabControl1.SelectedIndex = 0;
      this.tabControl1.Size = new System.Drawing.Size(336, 184);
      this.tabControl1.TabIndex = 2;
      //
      // tabPage1
      //
      this.tabPage1.Controls.AddRange(new System.Windows.Forms.Control[]
{
this.listView1});
      this.tabPage1.Location = new System.Drawing.Point(4, 22);
      this.tabPage1.Name = "tabPage1";
      this.tabPage1.Size = new System.Drawing.Size(328, 158);
      this.tabPage1.TabIndex = 0;
      this.tabPage1.Text = "tabPage1";
      //
      // listView1
      //
      this.listView1.AutoArrange = false;
      this.listView1.Columns.AddRange(
      new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
      this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
      this.listView1.Name = "listView1";
      this.listView1.Size = new System.Drawing.Size(328, 158);
      this.listView1.TabIndex = 0;
      this.listView1.View = System.Windows.Forms.View.Details;
      //
      // tabPage2
      //
      this.tabPage2.Controls.AddRange(new System.Windows.Forms.Control[]
{
this.vScrollBar1, this.hScrollBar1, this.trackBar1,
      this.dateTimePicker1});

      // the above should be this.trackBar1, this.dateTimePicker1 });

      this.tabPage2.Location = new System.Drawing.Point(4, 22);
      this.tabPage2.Name = "tabPage2";
      this.tabPage2.Size = new System.Drawing.Size(328, 158);
      this.tabPage2.TabIndex = 1;
      this.tabPage2.Text = "tabPage2";
      //
      // vScrollBar1
      //
      this.vScrollBar1.Location = new System.Drawing.Point(304, 8);
      this.vScrollBar1.Name = "vScrollBar1";
      this.vScrollBar1.Size = new System.Drawing.Size(17, 128);
      this.vScrollBar1.TabIndex = 3;
      //
      // hScrollBar1
      //
      this.hScrollBar1.Location = new System.Drawing.Point(8, 136);
      this.hScrollBar1.Name = "hScrollBar1";
      this.hScrollBar1.Size = new System.Drawing.Size(296, 17);
      this.hScrollBar1.TabIndex = 2;
      //
      // trackBar1
      //
      this.trackBar1.Location = new System.Drawing.Point(8, 40);
      this.trackBar1.Name = "trackBar1";
      this.trackBar1.Size = new System.Drawing.Size(288, 45);
      this.trackBar1.TabIndex = 1;
      //
      // dateTimePicker1
      //
      this.dateTimePicker1.Location = new System.Drawing.Point(8, 8);
      this.dateTimePicker1.Name = "dateTimePicker1";
      this.dateTimePicker1.Size = new System.Drawing.Size(288, 20);
      this.dateTimePicker1.TabIndex = 0;
      //
      // columnHeader1
      //
      this.columnHeader1.Text = "columnHeader1";
      this.columnHeader1.Width = 100;
      //
      // columnHeader2
      //
      this.columnHeader2.Text = "columnHeader2";
      this.columnHeader2.Width = 100;
      //
      // Form1
      //
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
      this.ClientSize = new System.Drawing.Size(352, 342);
      this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tabControl1, this.progressBar1, this.groupBox1});
      this.Name = "Form1";
      this.Text = "Form1";
      this.groupBox1.ResumeLayout(false);
      this.tabControl1.ResumeLayout(false);
      this.tabPage1.ResumeLayout(false);
      this.tabPage2.ResumeLayout(false);

((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
      this.ResumeLayout(false);
    }
    #endregion

    [STAThread]
    static void Main()
    {
      Application.Run(new Form1());
    }
  }
}


-- 
"Our enemies are innovative and resourceful - and so are we,"
"They never stop thinking about new ways to harm our country and our
people - and neither do we." - George W. Bush, Aug 2004




More information about the Mono-winforms-list mailing list