[Mono-winforms-list] Re: Showing a Messagebox

s.livingstone@btinternet.com s.livingstone@btinternet.com
Fri, 17 Oct 2003 09:26:21 +0100 (BST)


Hi Jordi - sorry for the delay... last day in this job and lot of running around.

So, on Windows i am running under the v1.1 .net runtime and NOT using Mono at all under Windows (i hope my mails before didn't cuase confusion on this!). I am *only* running Mono under Redhat Linux (i had tried to get Cygwin working, but gave up after unsuccessfully trying to get everything working together).

The code is below, however when i compile it i can only get "mcs hellopop.cs /r:System.Windows.Forms /r:System.Data /r:System.Windows.Forms" to compile this. If i try to include the references to System.Collections or System.Component model it tells me it cannot find these assemblies and true enough they are not in the /lib/... directory where the other ones are. Will this affect it?? I looking at the go-mono site and it seems to indicate these are available, but i'm not sure where they would be.

Any help much appreciated.
 - Steven

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

namespace HelloPop
{
	/// <summary>
	/// Summary description for hellopop.
	/// </summary>
	public class hellopop : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button button1;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public hellopop()
		{
			//
			// 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.button1 = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(144, 24);
			this.button1.Name = "button1";
			this.button1.TabIndex = 0;
			this.button1.Text = "button1";
			this.button1.Click  = new System.EventHandler(this.button1_Click);
			// 
			// hellopop
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(292, 273);
			this.Controls.Add(this.button1);
			this.Name = "hellopop";
			this.Text = "hellopop";
			this.ResumeLayout(false);

		}
		#endregion

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

============================================

>When you run your example under Windows are you using Mono under >Windows to 
>execute it (mono application.exe) or are you using the >Microsoft .Net runtime 
>to run it (./application). Can you post your little sample?

>Thanks,