[Mono-winforms-list] 1.1.9.1 Native Winforms Crash on OSX

Roberto Antonio Berrospe Machin robert at berlinprod.com
Mon Oct 3 16:19:24 EDT 2005


Here's my second test wich i did ussing Visual C#... just droped a combo box, label, text box, check box radio and button... then i've added a simple timer, and well.. this compiles and runs fine on Windows With Mono 1.1.9.1, but dont works on my mac :(



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

namespace testwforms
{
 /// <summary>
 /// Summary description for Form1.
 /// </summary>
 public class Form1 : System.Windows.Forms.Form
 {
  private System.Windows.Forms.Label label1;
  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.TextBox textBox1;
  private System.Windows.Forms.CheckBox checkBox1;
  private System.Windows.Forms.RadioButton radioButton1;
  private System.Windows.Forms.ComboBox comboBox1;
  private System.Windows.Forms.Timer timer1;
  private System.ComponentModel.IContainer components;
  private uint Seconds=0;
  public Form1()
  {
   //
   // Required for Windows Form Designer support
   //
   InitializeComponent();

   //
   // TODO: Add any constructor code after InitializeComponent call
   //
  }

  /// <summary>
  /// Clean up any resources being used.
  /// </summary>
  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 InitializeComponent()
  {
   this.components = new System.ComponentModel.Container();
   this.label1 = new System.Windows.Forms.Label();
   this.button1 = new System.Windows.Forms.Button();
   this.textBox1 = new System.Windows.Forms.TextBox();
   this.checkBox1 = new System.Windows.Forms.CheckBox();
   this.radioButton1 = new System.Windows.Forms.RadioButton();
   this.comboBox1 = new System.Windows.Forms.ComboBox();
   this.timer1 = new System.Windows.Forms.Timer(this.components);
   this.SuspendLayout();
   // 
   // label1
   // 
   this.label1.Location = new System.Drawing.Point(16, 8);
   this.label1.Name = "label1";
   this.label1.TabIndex = 1;
   this.label1.Text = "labeltest";
   // 
   // button1
   // 
   this.button1.Location = new System.Drawing.Point(144, 128);
   this.button1.Name = "button1";
   this.button1.TabIndex = 3;
   this.button1.Text = "button1";
   this.button1.Click += new System.EventHandler(this.button1_Click);
   // 
   // textBox1
   // 
   this.textBox1.Location = new System.Drawing.Point(16, 32);
   this.textBox1.Name = "textBox1";
   this.textBox1.Size = new System.Drawing.Size(88, 20);
   this.textBox1.TabIndex = 4;
   this.textBox1.Text = "labeltest";
   this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
   // 
   // checkBox1
   // 
   this.checkBox1.Location = new System.Drawing.Point(144, 32);
   this.checkBox1.Name = "checkBox1";
   this.checkBox1.TabIndex = 5;
   this.checkBox1.Text = "checkBox1";
   // 
   // radioButton1
   // 
   this.radioButton1.Location = new System.Drawing.Point(144, 56);
   this.radioButton1.Name = "radioButton1";
   this.radioButton1.TabIndex = 6;
   this.radioButton1.Text = "radioButton1";
   // 
   // comboBox1
   // 
   this.comboBox1.Location = new System.Drawing.Point(144, 8);
   this.comboBox1.Name = "comboBox1";
   this.comboBox1.Size = new System.Drawing.Size(121, 21);
   this.comboBox1.TabIndex = 9;
   this.comboBox1.Text = "comboBox1";
   // 
   // timer1
   // 
   this.timer1.Enabled = true;
   this.timer1.Interval = 1000;
   this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
   // 
   // Form1
   // 
   this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   this.ClientSize = new System.Drawing.Size(282, 164);
   this.Controls.Add(this.comboBox1);
   this.Controls.Add(this.radioButton1);
   this.Controls.Add(this.checkBox1);
   this.Controls.Add(this.textBox1);
   this.Controls.Add(this.button1);
   this.Controls.Add(this.label1);
   this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
   this.Name = "Form1";
   this.Text = "TrackBarValue=0";
   this.ResumeLayout(false);

  }
  #endregion

  /// <summary>
  /// The main entry point for the application.
  /// </summary>
  [STAThread]
  static void Main() 
  {
   Application.Run(new Form1());
  }

  private void textBox1_TextChanged(object sender, System.EventArgs e)
  {
   label1.Text=textBox1.Text;
  }

  private void button1_Click(object sender, System.EventArgs e)
  {
   MessageBox.Show("Button Pressed");
  }

  private void timer1_Tick(object sender, System.EventArgs e)
  {
   Seconds++;
   this.Text="Timer Second: "+Seconds;
  }


 }
}


Thanks.

Roberto.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20051003/52aa470c/attachment.html


More information about the Mono-winforms-list mailing list