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; using Microsoft.VisualBasic; namespace Sueldo_impuesto_06WF { public partial class Form1 : Form { 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; using Microsoft.VisualBasic; namespace Sueldo_impuesto_06WF { public partial class Form1 : Form { double sueldo, impuesto, p_impuesto; String msj; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { sueldo = Convert.ToDouble(textBox1.Text); if (sueldo >= 3000) { msj = "Debe pagar impuestos"; // para usar inputobox de VB hay que agregar referencia MICROSOFT.VISUALBASIC en add reference , .NET string texto = Microsoft.VisualBasic.Interaction.InputBox("Ingrese porcentaje", "Ingreso de porcentaje", "1"); p_impuesto = Convert.ToDouble(texto); impuesto = sueldo * (p_impuesto / 100); } else { msj = "NO Debe pagar impuestos"; impuesto = 0; } textBox4.Text = msj; textBox5.Text = Convert.ToString(impuesto); } private void button2_Click(object sender, EventArgs e) { textBox1.Text=""; textBox4.Text = ""; textBox5.Text = ""; } private void button3_Click(object sender, EventArgs e) { this.Close(); } } }