Native Cross Platform UI made easy.

Eto.Forms

Eto.Forms lets you build native desktop applications with a single, shared .NET codebase.

Install the templates and create an app
dotnet new install Eto.Forms.Templates
dotnet new etoapp -o MyApp
cd MyApp
dotnet run
MainForm.cs
public class MainForm : Form
{
    public MainForm()
    {
        Title = "Hello Eto";

        var nameBox = new TextBox { PlaceholderText = "Your name" };
        var helloButton = new Button { Text = "Say Hello" };
        helloButton.Click += (sender, e) =>
            MessageBox.Show(this, $"Hello, {nameBox.Text}!");

        Content = new StackLayout
        {
            Padding = 10,
            Spacing = 5,
            HorizontalContentAlignment = HorizontalAlignment.Stretch,
            Items = { "What's your name?", nameBox, helloButton }
        };
    }
}
MainForm.xeto
<Form xmlns="http://schema.picoe.ca/eto.forms"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="Hello Eto" Padding="10">
  <StackLayout Spacing="5" HorizontalContentAlignment="Stretch">
    <Label>What's your name?</Label>
    <TextBox x:Name="nameBox" PlaceholderText="Your name" />
    <Button Text="Say Hello" Click="HandleSayHello" />
  </StackLayout>
</Form>
MainForm.xeto.cs
public class MainForm : Form
{
    TextBox nameBox;

    public MainForm() => XamlReader.Load(this);

    protected void HandleSayHello(object sender, EventArgs e) =>
        MessageBox.Show(this, $"Hello, {nameBox.Text}!");
}
MainForm.jeto
{
  "$type": "Form",
  "Title": "Hello Eto",
  "Padding": "10",
  "Content": {
    "$type": "StackLayout",
    "Spacing": "5",
    "HorizontalContentAlignment": "Stretch",
    "Items": [
      "What's your name?",
      { "$type": "TextBox", "$name": "nameBox", "PlaceholderText": "Your name" },
      { "$type": "Button", "Text": "Say Hello", "Click": "HandleSayHello" }
    ]
  }
}
MainForm.jeto.cs
public class MainForm : Form
{
    TextBox nameBox;

    public MainForm() => JsonReader.Load(this);

    protected void HandleSayHello(object sender, EventArgs e) =>
        MessageBox.Show(this, $"Hello, {nameBox.Text}!");
}
MainForm.fs
type MainForm() as this =
    inherit Form()
    do
        this.Title <- "Hello Eto"

        let nameBox = new TextBox(PlaceholderText = "Your name")
        let helloButton = new Button(Text = "Say Hello")
        helloButton.Click.Add(fun _ ->
            MessageBox.Show(this, $"Hello, {nameBox.Text}!") |> ignore)

        let layout = new StackLayout(Padding = 10, Spacing = 5, HorizontalContentAlignment = HorizontalAlignment.Stretch)
        layout.Items.Add("What's your name?")
        layout.Items.Add(StackLayoutItem(nameBox))
        layout.Items.Add(StackLayoutItem(helloButton))
        this.Content <- layout
MainForm.py
import Eto.Forms as forms
import Eto.Drawing as drawing

class MainForm(forms.Form):
    def __init__(self):
        super(MainForm, self).__init__()
        self.Title = "Hello Eto"

        nameBox = forms.TextBox()
        nameBox.PlaceholderText = "Your name"
        helloButton = forms.Button()
        helloButton.Text = "Say Hello"
        helloButton.Click += lambda sender, e: forms.MessageBox.Show(self, "Hello, {}!".format(nameBox.Text))

        label = forms.Label()
        label.Text = "What's your name?"

        layout = forms.StackLayout(
            forms.StackLayoutItem(label),
            forms.StackLayoutItem(nameBox),
            forms.StackLayoutItem(helloButton))
        layout.Padding = drawing.Padding(10)
        layout.Spacing = 5
        layout.HorizontalContentAlignment = forms.HorizontalAlignment.Stretch
        self.Content = layout
The sample app running on Windows
Windows
The sample app running on macOS
macOS

Why Eto.Forms

Everything you need for native apps everywhere.

One .NET codebase, three desktops, and no compromises on how your app looks or feels.

One codebase

Write your UI once. In the language you love.

Describe your interface in C#, F# or VB.NET, or keep it declarative with XAML or JSON. However you write it, the same UI ships to Windows, macOS and Linux without a single #if.

  • Layouts like StackLayout and TableLayout size themselves, so there’s no pixel pushing.
  • Data binding keeps your views and models in sync with a line of code.
  • Mix code and markup freely, even in the same window.
Try the tutorials

Truly native

Not a lookalike. The real thing.

Eto.Forms doesn’t draw its own imitation widgets. Every button, list and dialog is the platform’s own: WPF or WinForms on Windows, Cocoa on macOS and GTK on Linux. Your app looks, feels and behaves like it belongs, because it does.

  • Accessibility, keyboard navigation and text input come straight from the OS.
  • Native rendering means fast startup and a small footprint.
  • Release builds bundle .NET, so users just download and run.
See supported platforms

No dead ends

Drop to native whenever you need to.

Cross-platform shouldn’t mean lowest common denominator. Reach the underlying native control from any Eto control, add platform-specific styles, or build custom controls with a native implementation for each platform.

  • Embed Eto in an existing WinForms, WPF or Cocoa app, one window at a time.
  • Host native controls inside your Eto layouts.
  • Style controls per platform without touching your shared code.
Read about embedding

Developer extensions

See it before you run it.

The developer extensions for Visual Studio, VS Code and Rider put a live preview right beside your editor. It redraws as you type, on the platform and theme you choose, so you can design without the build and run loop.

  • IntelliSense for controls, properties, events and bindings in XAML and JSON.
  • Jump between designer and code with a single key.
  • Project and item templates to get going in seconds.
Get the extensions