Dia Mejor

Practica 1.2 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_Problema2_windows
{
public partial class Form1 : Form
{
int horas, minutos, segundos, dias;
public Form1()
{
InitializeComponent();
horas = minutos = segundos = dias = 0;
}
private void btconversion_Click(object sender, EventArgs e)
{
if (txthoras.Text == "")
{
MessageBox.Show("Oye te equivocaste", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.RtlReading
MessageBoxOptions.RightAlign);
listBox1.Items.Clear();
txthoras.Clear();
txthoras.Focus();
}
else
{
horas = int.Parse(txthoras.Text);
minutos = horas * 60;
segundos = minutos * 60;
dias = horas / 24;
listBox1.Items.Add("Valor en horas" + horas);
listBox1.Items.Add("Valor en minutos" + minutos);
listBox1.Items.Add("Valor en segundos" + segundos);
listBox1.Items.Add("Valor en d¡as" + dias);
}
}
private void btcancelar_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
txthoras.Clear();
txthoras.Focus();
}
private void btsalir_Click(object sender, EventArgs e)
{
Close();
}
}
}

 

0 Response to “Practica 1.2 windows”

Leave a Reply