Exemple #1
0
        }//end

        /// <summary>
        /// Button for Decimal > Base conversion
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            //textBox2.Text = BaseConverter.ResultsPlace((int)numericUpDown2.Value - BaseConverter.FromDecimal(int.Parse(textBox1.Text), (int)numericUpDown1.Value).Length);
            if (textBox1.Text == string.Empty)
            {
                MessageBox.Show("Please consider inputting a number before pressing that button.");
            }
            else
            {
                textBox2.Text = BaseConverter.ResultsPlace((int)numericUpDown2.Value - BaseConverter.FromDecimal(int.Parse(textBox1.Text), (int)numericUpDown1.Value).Length, (int)numericUpDown1.Value) + BaseConverter.FromDecimal(int.Parse(textBox1.Text), (int)numericUpDown1.Value);
            }
            textBox1.ForeColor = Color.Blue;
            textBox2.ForeColor = Color.Red;
        }//end