Skip to content

Tutorial 1 Hello Eto.Forms

Petr Hluzín edited this page Aug 15, 2014 · 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 : Eto.Forms.Form
     {
     	public MyForm()
     	{
     		// sets the client (inner) size of the window for your content
     		this.ClientSize = new Eto.Drawing.Size(600, 400);
    
     		this.Title = "Hello, Eto.Forms";
     	}
     }
    
  3. In your main() function, create an Application object and handle the Initialized event:

     var app = new Eto.Forms.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