viernes, 27 de febrero de 2009

problema 3 visual 3


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