using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class FrmEjercicio1 : Form
{
double[] corriente;
double[] resistencia;
double[] potencia;
int I;
public FrmEjercicio1()
{
corriente = new double[10];
potencia = new double[10];
I =0;
InitializeComponent();
}
private void cmdAceptar_Click(object sender, EventArgs e)
{
if (I < 10)
{
corriente[I] = double.Parse(textBox1.Text);
lbDesplegar.Items.Add(corriente[I].ToString());
textBox1.Clear();
textBox1.Focus();
I = I + 1;
}
else
{
MessageBox.Show("Solo aceptan 10 datos");
}
}
}
}

No hay comentarios:
Publicar un comentario