[IronPython] Making A Windows Form App

Freddie Witherden freddiewitherden at hotmail.com
Wed Jul 6 21:03:58 CEST 2005


Hi, I am trying to convert a very simple C# windows form test that I made 
into IronPython (to see that it can be done). However I have tried over 20 
different ways with no luck. Can anyone help me? There is very very little 
documentation on IronPython, which I think needs to be addressed. The code 
is:
using System;
using System.Drawing;
using System.Windows.Forms;

namespace WinForms
{
	public class HelloWorld : System.Windows.Forms.Form
	{

		private Button btn;

		public HelloWorld()
		{
            Text = "Hello World";

			btn = new Button();
			btn.Location = new Point(50,50);
			btn.Text = "Goodbye";
			btn.Click += new System.EventHandler(btn_Click);

			Controls.Add(btn);
		}

		static void Main()
		{
			Application.Run(new HelloWorld());
		}

		private void btn_Click(object sender, EventArgs e)
		{
			Application.Exit();
		}
	}
}





More information about the Ironpython-users mailing list