Add additional polish

This commit is contained in:
2022-10-03 15:49:04 -05:00
parent c401da8662
commit d9c6c69486
14 changed files with 216 additions and 27 deletions

View File

@@ -27,7 +27,7 @@ namespace WindowsFormsApplication1
case "hexTextBox":
hexTextBox.Focus();
break;
case "octalRadioButton":
case "octalTextBox":
octalTextBox.Focus();
break;
case "decimalTextBox":
@@ -72,12 +72,16 @@ namespace WindowsFormsApplication1
hexNum = decimalNum;
binNum = decimalNum;
octalNum = decimalNum;
//Refocus the textbox when done.
currentFocus("decimalTextBox");
}
if (octalRadioButton.Checked) {
// The octal radio button is pressed.
hexNum = octalNum;
binNum = octalNum;
decimalNum = octalNum;
//Refocus the textbox when done.
currentFocus("octalTextBox");
}
if (hexRadioButton.Checked)
@@ -86,7 +90,8 @@ namespace WindowsFormsApplication1
binNum = hexNum;
decimalNum = hexNum;
octalNum = hexNum;
//Refocus the textbox when done.
currentFocus("hexTextBox");
}
if (binaryRadioButton.Checked)
{
@@ -94,12 +99,17 @@ namespace WindowsFormsApplication1
hexNum = binNum;
decimalNum = binNum;
octalNum = binNum;
//Refocus the textbox when done.
currentFocus("binaryTextBox");
}
// Print output
decimalTextBox.Text = decimalNum.ToString();
hexTextBox.Text = hexNum.ToString("X");
binaryTextBox.Text = Convert.ToString(binNum, 2);
octalTextBox.Text = Convert.ToString(octalNum, 8);
}
private void clearButton_Click(object sender, EventArgs e)