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
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int opcion;
opcion=int.Parse(comboBox1.Text);
switch (opcion)
{
case 1:
textBox1.Visible = true;
textBox1.Focus();
break;
case 2:
textBox2.Visible = true;
textBox2.Focus();
break;
case 3:
textBox3.Visible = true;
textBox3.Focus();
break;
case 4:
textBox4.Visible = true;
textBox4.Focus();
break;
case 5:
textBox5.Visible = true;
textBox5.Focus();
break;
}
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = "0";
textBox2.Text = "0";
textBox3.Text = "0";
textBox4.Text = "0";
textBox5.Text = "0";
}
private void button2_Click(object sender, EventArgs e)
{
int P1, P2, P3, P4, P5;
double total;
P1 = int.Parse(textBox1.Text);
P2 = int.Parse(textBox2.Text);
P3 = int.Parse(textBox3.Text);
P4 = int.Parse(textBox4.Text);
P5 = int.Parse(textBox5.Text);
total = (P1 * 29.80) + (P2 * 45.00) + (P3 * 99.80) + (P4 * 44.90) + (P5 * 68.75);
textBox6.Visible = true;
textBox6.Text = "$"+total.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox5.Clear();
comboBox1.Focus();
}
private void button4_Click(object sender, EventArgs e)
{
Close();
}
}
}
No hay comentarios:
Publicar un comentario