All pastes #181915 Raw Edit

Mine

public text v1 · immutable
#181915 ·published 2006-09-25 14:16 UTC
rendered paste body
using System;
using Gtk;

public class MainWindow: Gtk.Window
{	
	public MainWindow (): base ("")
	{
		Stetic.Gui.Build (this, typeof(MainWindow));
	}
	
	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
	{
		Application.Quit ();
		a.RetVal = true;
	}

private void btnbutton1_Click(object sender, System.EventArgs e)
{
   txtErgebnis.Text = string.format("{0}", Int64.Parse(txtEntry1.Text) + Int64.Parse(txtEntry2.Text));
}

private void btnbutton2_Click(object sender, System.EventArgs e)
{
    try
    {
      double nentry1 = Double.Parse(txtentry1.Text);
      double nentry2 = Double.Parse(txtentry2.Text);
      txtErgebnis.Text = (nentry2 != 0) ? "Division durch 0" : string.format("{0}", nentry1 / nentry2);
     }
    catch
    {
      txtErgebnis.Text = "Keine Zahl angegeben!";
    }
    finally
    {
    }
}