http://www.mono-project.com/WinForms_Getting_Started_Guide
To build Windows.Forms from source, you need:
* The latest Mono (http://www.go-mono.com/download.html) package.
* The latest libgdiplus (http://www.go-mono.com/download.html)
library. Not needed on Windows XP since it includes gdiplus.dll
and for Windows 2000 it can be downloaded from MSDN.
[Paul Johnson provides a nice writup on how to build from source here
(http://www.all-the-johnsons.co.uk/mono/mono-compiling.shtml)]
Winforms Example
As there are plenty of great articles and books on Windows Forms
programming, the topic will not be covered in-depth. The following
is just a simple Winforms program to test with.
using System;
using System.Drawing;
using System.Windows.Forms;
public class HelloWorld : Form
{
static public void Main ()
{
Application.Run (new HelloWorld ());
}
public HelloWorld ()gpp
{
Button b = new Button ();
b.Text = "Click Me!";
b.Click += new EventHandler (Button_Click);
Controls.Add (b);
}
private void Button_Click (object sender, EventArgs e)
{
MessageBox.Show ("Button Clicked!");
}
}
If you save this code as hello.cs, you would compile it like this:
mcs -pkg:dotnet hello.cs
Using mcs to compile produces a .Net 1.1 assembly. To create a .Net 2.0 assembly, use gmcs:
gmcs -pkg:dotnet hello.cs
Either compiler will create "hello.exe", which you can run using:
mono hello.exe
Subscribe to:
Post Comments (Atom)
-
* postgres - pgmodelear ** new version > download: https://github.com/pgmodeler/pgmodeler sudo apt-get install qt-sdk sudo apt-get ins...
-
--> from: http://www.howardism.org/Technical/Emacs/literate-programming-tutorial.html Introduction to Literate Programming ...
-
유럽 연합 법규는 유럽 연합 방문자에게 블로그에 사용되는 쿠키에 대한 정보를 제공하도록 규제하고 있습니다. 또한 대부분의 경우 이러한 법규는 사용자의 동의를 얻도록 요구합니다. 이 규제를 준수할 수 있도록 Google은 귀하의 블로그에 Google이 ...
No comments:
Post a Comment