All pastes #188843 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-10-02 15:42 UTC
rendered paste body
using System;

using System.Drawing;

using System.Text;

using System.Windows.Forms;



public class Form1: Form {



	private Button button1;



	public Form1 ()

	{

		this.button1 = new System.Windows.Forms.Button ();

		this.SuspendLayout ();


		this.button1.Location = new System.Drawing.Point (99, 82);

		this.button1.Name = "button1";

		this.button1.Size = new System.Drawing.Size (75, 23);

		this.button1.TabIndex = 0;

		this.button1.Text = "Close";

		this.button1.Click += new System.EventHandler (this.button1_Click);

		this.button1.MouseEnter += new System.EventHandler (this.button1_MouseEnter);


		this.ClientSize = new System.Drawing.Size (292, 266);

		this.Controls.Add (this.button1);

		this.Name = "Form1";

		this.Text = "Form1";

		this.ResumeLayout (false);
	}



	private void button1_Click (object sender, EventArgs e)

	{

		Close ();

	}



	private void button1_MouseEnter (object sender, EventArgs e)

	{
		this.MouseMove += new MouseEventHandler (form_MouseMove);

		Cursor.Position = Cursor.Position;

		this.MouseMove -= new MouseEventHandler (form_MouseMove);

	}

	private void form_MouseMove (object sender, MouseEventArgs mea)
	{
		Console.WriteLine ("Mouse moved to {0},{1}", mea.X, mea.Y);
	}



	[STAThread]

	static void Main ()

	{

		Application.Run (new Form1 ());

	}

}