Saturday, April 30, 2005

Starting with MWF

You will need libgdiplus installled on your system. (if you are running Ubuntu Breezy, you can use my personal ubuntu repository.

You also need Windows.Forms, if you need it just download it from here.

Yoy will need to install it with gacutil:
sudo gacutil -i System.Windows.Forms.dll

Now you can execute WindowsForm Apps ;)

Lets code..
Open monodevelop and create a new empty project. On the *Solution* window -> references -> Add reference and select System.Windows.Forms.



Create a new empty file and rename it to Main.cs and add the next code:
// created on 30/04/2005 at 17:38
using System.Windows.Forms;

class HelloWindowsForms
{

        public static void Main()
        {
                MessageBox.Show ("Hello World!");
        }

}


Well.. after this tipical 'hello world', we will try something more interesting...
// created on 30/04/2005 at 17:38
using System;
using System.Windows.Forms;


class MyForm : System.Windows.Forms.Form
{
 private RadioButton MyRadioButton;
 private System.ComponentModel.Container components = null;

 public MyForm()
 {
  InitializeComponent();
 }

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

 private void InitializeComponent()
 {
     this.MyRadioButton = new RadioButton();    
     this.MyRadioButton.Text = "My RadioButton";     
  this.Controls.AddRange(new System.Windows.Forms.Control[]{this.MyRadioButton}); 
 }

}

My personal Ubuntu Breezy repository

Hi childrens, I'm setting up my personal breezy repository where I'm backporting several packages. You will find mono 1.1.6 (with preview 2.0), monodevelop 0.6, planner 0.13, emacs-snapshot with gtk2 support...

For more information check the following url out:
http://people.hazent.com/~jrp/ubuntu/dists/breezy/hazent/binary-i386/Packages.gz

Add this line to your /etc/apt/sources.list:
deb http://people.hazent.com/~jrp/ubuntu breezy hazent