/// <summary>
        /// This is the event handler for the HeightLabel Click Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ActiveLabel_Click(object sender, EventArgs e)
        {
            if (ActiveLabel != null)
            {
                ActiveLabel.BackColor = Color.White;
                ActiveLabel           = null;
            }

            ActiveLabel = sender as Label;

            ActiveLabel.BackColor = Color.LightBlue;

            NumericKeyboardPanel.Visible = true;

            if (ActiveLabel.Text != "0")
            {
                ResultLabel.Text = ActiveLabel.Text;
                outputString     = ActiveLabel.Text;
            }

            //CalculatorButtonTableLayoutPanel.Location = new Point(12, ActiveLabel.Location.Y + 55);
            NumericKeyboardPanel.BringToFront();

            AnimationTimer.Enabled = true;
            animationState         = Animation.UP;
        }
Example #2
0
        /// <summary>
        /// This is the Event Handler for the Height Label Click event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ActiveLabel_Click(object sender, EventArgs e)
        {
            //if statement to only click 1 label at a time
            if (ActiveLabel != null)
            {
                ActiveLabel.BackColor = Color.White;
                ActiveLabel           = null;
            }
            ActiveLabel = sender as Label;

            ActiveLabel.BackColor = Color.LightBlue; // label turns blue when clicked

            NumericKeyboardPanel.Visible = true;

            //if value in the label is not 0, take the value of the text
            //and put it in the result label and outputstring
            if (ActiveLabel.Text != "0")
            {
                ResultLabel.Text = ActiveLabel.Text;
                outputString     = ActiveLabel.Text;
            }

            //CalculatorButtonTableLayoutPanel.Location = new Point(12, ActiveLabel.Location.Y + 55);
            NumericKeyboardPanel.BringToFront();

            AnimationTimer.Enabled = true;
            animationState         = Animation.UP;
        }
 /// <summary>
 /// This is the event handler for the heightlabel click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ActiveLabel_Click(object sender, EventArgs e)
 {
     if (ActiveLabel != null)
     {
         ActiveLabel.BackColor = Color.White;
         ActiveLabel           = null;
     }
     ActiveLabel                  = sender as Label;
     ActiveLabel.BackColor        = Color.LightBlue;
     NumericKeyboardPanel.Visible = true;
     if (ActiveLabel.Text != "0")
     {
         lblResult.Text = ActiveLabel.Text;
         outputString   = ActiveLabel.Text;
     }
     NumericKeyboardPanel.Location = new Point(12, ActiveLabel.Location.Y + 40);
     NumericKeyboardPanel.BringToFront();
     AnimationTimer.Enabled = true;
 }