Add additional polish
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user