Dia Mejor

Practica 1.3 windows

Author: Moises



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Practica1_Problema3_windows
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btconversion_Click(object sender, EventArgs e)
{
double far, cel;
if (txtGrados.Text == "")
{
MessageBox.Show("Oye te equivocaste", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.RtlReading
MessageBoxOptions.RightAlign);
txtGrados.Clear();
txtCenti.Clear();
txtGrados.Focus();
}
else
{
far = double.Parse(txtGrados.Text);
cel = 5.0 / 9.0 * (far - 32);
txtCenti.Text = cel.ToString();
}
}
private void btcancelar_Click(object sender, EventArgs e)
{
txtGrados.Clear();
txtCenti.Clear();
txtGrados.Focus();
}
private void btsalir_Click(object sender, EventArgs e)
{
Close();
}
}
}

 

0 Response to “Practica 1.3 windows”

Leave a Reply