-
-
Notifications
You must be signed in to change notification settings - Fork 337
Tutorial 1 Hello Eto.Forms
cwensley edited this page Apr 9, 2012
·
9 revisions
This tutorial will teach you how to create a simple "Hello World" application using Eto.Forms
-
Follow Preparing your solution to create your solution
-
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); // create a label var label = new Label { Text = "Hello Eto World" }; // add the label to the window (using an extension method of DockLayout) this.AddDockedControl (label); } }
-
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);
-
In order to run your application, follow Running your application