20091109

PRACTICA 8.3 ARREGLOS UNIDIMENSIONALES (visual)


A continuacion el ejecutble del programa dearreglos unidimensionale.

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 WindowsFormsApplication2
{
public partial class Form1 : Form
{
int[] corriente;
int[] resistencia;
int[] voltios;
int I;
public Form1()
{
InitializeComponent();
corriente = new int[10];
resistencia = new int[10];
voltios = new int[10];
I = 0;
}
private void button1_Click(object sender, EventArgs e)
{
if (I <= 10)
{
textBox1.Focus();
corriente[I] = int.Parse(textBox1.Text);

resistencia[I] = int.Parse(textBox2.Text);
voltios[I] = corriente[I] * resistencia[I];
I++;
textBox2.Clear();
textBox1.Clear();
}
else
{
button1.Enabled = false;
}
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Add("Corriente Resistencia Voltios");
for (I = 0; I < 10; I++)
{
listBox1.Items.Add(corriente[I].ToString() + "\t\t" + resistencia[I].ToString() + "\t\t" + voltios[I].ToString());
}
}
private void button3_Click(object sender, EventArgs e)
{
}
private void button4_Click(object sender, EventArgs e)
{
Close();
}
}
}

No hay comentarios:

Publicar un comentario