private void numerosIngresados_TextChanged(object sender, EventArgs e) { clConverter objConverter = new clConverter(numerosIngresados.Text); try { if (rbBin.Checked == true) { resulBinario.Text = numerosIngresados.Text; resulOctal.Text = objConverter.BinaryToOctal(); resulDecimal.Text = objConverter.BinaryToDecimal(); resulHexa.Text = objConverter.BinaryToHexadecimal().ToUpper(); } if (rbOctal.Checked == true) { resulBinario.Text = objConverter.OctalToBinary(); resulOctal.Text = numerosIngresados.Text; resulDecimal.Text = objConverter.OctalToDecimal(); resulHexa.Text = objConverter.OctalToHexadecimal().ToUpper(); } if (rbDeci.Checked == true) { resulBinario.Text = objConverter.DecimalToBinary(); resulOctal.Text = objConverter.DecimalToOctal(); resulDecimal.Text = numerosIngresados.Text; resulHexa.Text = objConverter.DecimalToHexadecimal().ToUpper(); } if (rbHex.Checked == true) { resulBinario.Text = objConverter.HexadecimalToBinary(); resulOctal.Text = objConverter.HexadecimalToOctal(); resulDecimal.Text = objConverter.HexadecimalToDecimal(); resulHexa.Text = numerosIngresados.Text; } if (numerosIngresados.Text == "") { numerosIngresados.Text = "0"; } } catch { } }
private void valorOperacion3() { if (rbHex.Checked == true) { valor2 = double.Parse(resulDecimal.Text); } else { clConverter objConverter = new clConverter(Math.Round(double.Parse(operacion3)).ToString()); if (rbBin.Checked == true) { valor2 = double.Parse(objConverter.BinaryToDecimal()); } if (rbOctal.Checked == true) { valor2 = double.Parse(objConverter.OctalToDecimal()); } if (rbDeci.Checked == true) { valor2 = double.Parse(operacion3); } } }
private void valorEntero1() { if (rbHex.Checked == true) { valor1 = double.Parse(resulDecimal.Text); } else { clConverter objConverter = new clConverter(Math.Round(double.Parse(numerosIngresados.Text)).ToString()); if (rbBin.Checked == true) { valor1 = double.Parse(objConverter.BinaryToDecimal()); } if (rbOctal.Checked == true) { valor1 = double.Parse(objConverter.OctalToDecimal()); } if (rbDeci.Checked == true) { valor1 = double.Parse(numerosIngresados.Text); } } }