All pastes #181913 Raw Edit

Mine

public text v1 · immutable
#181913 ·published 2006-09-25 14:14 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);
      if (nentry2 != 0) {
        txtErgebnis.Text = string.format("{0}", nentry1 / nentry2);
      }
      else {
        txtErgebnis.Text = "Division durch 0";
      }
     }
catch {
txtErgebnis.Text = "Keine Zahl angegeben!";
}
finally
{
}
}