Skip to content

Tutorial 1 Hello Eto.Forms

cwensley edited this page Apr 10, 2012 · 9 revisions

This tutorial will teach you how to create a simple "Hello World" application using Eto.Forms

  1. Follow Preparing your solution to create your solution

  2. Create a new class for your main form:

     class MyForm : Form
     {
     	public MyForm()
     	{
     		// sets the client (inner) size of the window for your content
     		this.ClientSize = new Size(600, 400);
    
     		this.Text = "Hello, Eto.Forms";
     	}
     }
    
  3. In your main() function, create an Application object and handle the Initialized event:

     var app = new Application ();
     
     app.Initialized += delegate {
     	// only create new controls/forms/etc during or after this event
     	app.MainForm = new MyForm ();
     	app.MainForm.Show ();
     };
     
     app.Run (args);
    
  4. In order to run your application, follow Running your application

Source Code

Next: Tutorial 2 Menus & Toolbars