Dia Mejor

Practica 1.1 windows

Author: Moises



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Practica1_Problema1_windows
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btCotizar_Click(object sender, EventArgs e)
{
double ancho, largo, costo, costototal;
ancho = double.Parse(txtAncho.Text);
largo = double.Parse(txtLargo.Text);
costo = double.Parse(txtCosto.Text);
costototal = ancho * largo * costo;
if (txtAncho.Text == "" txtLargo.Text == "" txtCosto.Text == "")
{
MessageBox.Show("Oye te equivocaste", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.RtlReading
MessageBoxOptions.RightAlign);
}
else
{
txtCostototal.Text = costototal.ToString();
}
}
private void btSalir_Click(object sender, EventArgs e)
{
Close();
}
private void btCancelar_Click(object sender, EventArgs e)
{
txtAncho.Clear();
txtLargo.Clear();
txtCosto.Clear();
txtCostototal.Clear();
txtAncho.Focus();
}
}
}

 

0 Response to “Practica 1.1 windows”

Leave a Reply