![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcnFJZxScFg5ZyJ-ovvC2IJJZF7D8yKGtGY3ep0MVLFkyyGiYCapsHkK7Szoz7GjJiWJgBl49nez21gRNvlCmDzTDh07Q6F1jjqDDCKmQJ6dusrQuBapCggyfQ0CMphVCmxVWJFDggP398/s320/Dibujo+7.bmp)
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
int H, M, S, D;
public Form1()
{
H = M = S = D = 0;
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "")
MessageBox.Show("Introduce cantidad de horas por favor");
else
{
H = int.Parse(textBox1.Text);
M = (H * 60);
S = (H * 3600);
D = (H / 24);
listBox1.Items.Add("Horas convertidas=" + H);
listBox1.Items.Add("DIAS=" + D);
listBox1.Items.Add("MINUTOS=" + M);
listBox1.Items.Add("SEGUNDOS=" + S);
listBox1.Items.Add("");
}
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox1.Focus();
listBox1.Items.Clear();
No hay comentarios:
Publicar un comentario