Beispiel #1
0
 /// <summary>
 /// This is the event handler that occurs when the form is opened
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BMICalculator_Load(object sender, EventArgs e)
 {
     ImperialRadioButton.Checked = true;
     BackSpaceButton.Hide();
     ZeroButton.Hide();
     OneButtton.Hide();
     TwoButton.Hide();
     ThreeButton.Hide();
     FourButton.Hide();
     FiveButton.Hide();
     SixButton.Hide();
     SevenButton.Hide();
     EightButton.Hide();
     NineButton.Hide();
     this.ProgressBar.Increment(10);
     HeightTextBox.Enabled = true;
     WeightTextBox.Enabled = true;
 }
Beispiel #2
0
 /// <summary>
 /// When the HeightTextBox is clicked, the following code starts functioning
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HeightTextBox_Click(object sender, EventArgs e)
 {
     OneButtton.Show();
     TwoButton.Show();
     ThreeButton.Show();
     FourButton.Show();
     FiveButton.Show();
     SixButton.Show();
     SevenButton.Show();
     EightButton.Show();
     NineButton.Show();
     BackSpaceButton.Show();
     HeightTextBox.Enabled = true;
     if ((ImperialRadioButton.Checked) || (MetricRadioButton.Checked))
     {
         if (HeightTextBox.Text != "")
         {
             ProgressBar.Value = 25;
         }
     }
 }
Beispiel #3
0
        // Calculator_KeyPress: Checks for user input through KeyPresses and performs
        // the corresponding Click-event for the appropriate button.
        // Pre: -
        // Post: The KeyPress-event has been handled and, if there's a match, the appropriate
        // buttons Click-event has been fired.
        private void Calculator_KeyPress(object sender, KeyPressEventArgs e)
        {
            switch (e.KeyChar)
            {
            case '1': OneButton.PerformClick(); break;

            case '2': TwoButton.PerformClick(); break;

            case '3': ThreeButton.PerformClick(); break;

            case '4': FourButton.PerformClick(); break;

            case '5': FiveButton.PerformClick(); break;

            case '6': SixButton.PerformClick(); break;

            case '7': SevenButton.PerformClick(); break;

            case '8': EightButton.PerformClick(); break;

            case '9': NineButton.PerformClick(); break;

            case '0': ZeroButton.PerformClick(); break;

            case '/': DivideButton.PerformClick(); break;

            case '*': MultiplyButton.PerformClick(); break;

            case '-': SubtractButton.PerformClick(); break;

            case '+': AddButton.PerformClick(); break;

            case ',': CommaButton.PerformClick(); break;

            case 'C': ClearButton.PerformClick(); break;

            case 'c': ClearButton.PerformClick(); break;
            }
            e.Handled = true;
        }
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

            if (AdditionButton != null)
            {
                AdditionButton.Dispose();
                AdditionButton = null;
            }

            if (ClearButton != null)
            {
                ClearButton.Dispose();
                ClearButton = null;
            }

            if (DisplayLabel != null)
            {
                DisplayLabel.Dispose();
                DisplayLabel = null;
            }

            if (DivisionButton != null)
            {
                DivisionButton.Dispose();
                DivisionButton = null;
            }

            if (EightButton != null)
            {
                EightButton.Dispose();
                EightButton = null;
            }

            if (EqualsButton != null)
            {
                EqualsButton.Dispose();
                EqualsButton = null;
            }

            if (FiveButton != null)
            {
                FiveButton.Dispose();
                FiveButton = null;
            }

            if (FourButton != null)
            {
                FourButton.Dispose();
                FourButton = null;
            }

            if (historyCalcSwipeGesture != null)
            {
                historyCalcSwipeGesture.Dispose();
                historyCalcSwipeGesture = null;
            }

            if (MultiplyButton != null)
            {
                MultiplyButton.Dispose();
                MultiplyButton = null;
            }

            if (NineButton != null)
            {
                NineButton.Dispose();
                NineButton = null;
            }

            if (OneButton != null)
            {
                OneButton.Dispose();
                OneButton = null;
            }

            if (SevenButton != null)
            {
                SevenButton.Dispose();
                SevenButton = null;
            }

            if (SixButton != null)
            {
                SixButton.Dispose();
                SixButton = null;
            }

            if (SubtractButton != null)
            {
                SubtractButton.Dispose();
                SubtractButton = null;
            }

            if (SymbolLabel != null)
            {
                SymbolLabel.Dispose();
                SymbolLabel = null;
            }

            if (ThreeButton != null)
            {
                ThreeButton.Dispose();
                ThreeButton = null;
            }

            if (TwoButton != null)
            {
                TwoButton.Dispose();
                TwoButton = null;
            }

            if (ZeroButton != null)
            {
                ZeroButton.Dispose();
                ZeroButton = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (ClearButton != null)
            {
                ClearButton.Dispose();
                ClearButton = null;
            }

            if (CodeLabel != null)
            {
                CodeLabel.Dispose();
                CodeLabel = null;
            }

            if (EightButton != null)
            {
                EightButton.Dispose();
                EightButton = null;
            }

            if (FiveButton != null)
            {
                FiveButton.Dispose();
                FiveButton = null;
            }

            if (FourButton != null)
            {
                FourButton.Dispose();
                FourButton = null;
            }

            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (LoginFrameView != null)
            {
                LoginFrameView.Dispose();
                LoginFrameView = null;
            }

            if (LoginTitleLabel != null)
            {
                LoginTitleLabel.Dispose();
                LoginTitleLabel = null;
            }

            if (NineButton != null)
            {
                NineButton.Dispose();
                NineButton = null;
            }

            if (OneButton != null)
            {
                OneButton.Dispose();
                OneButton = null;
            }

            if (RoleButton != null)
            {
                RoleButton.Dispose();
                RoleButton = null;
            }

            if (RolePickerView != null)
            {
                RolePickerView.Dispose();
                RolePickerView = null;
            }

            if (SevenButton != null)
            {
                SevenButton.Dispose();
                SevenButton = null;
            }

            if (SixButton != null)
            {
                SixButton.Dispose();
                SixButton = null;
            }

            if (ThreeButton != null)
            {
                ThreeButton.Dispose();
                ThreeButton = null;
            }

            if (TwoButton != null)
            {
                TwoButton.Dispose();
                TwoButton = null;
            }

            if (ZeroButton != null)
            {
                ZeroButton.Dispose();
                ZeroButton = null;
            }
        }
Beispiel #6
0
        private void Form1_KeyPress(object sender, KeyPressEventArgs e)
        {
            switch (e.KeyChar.ToString())
            {
            case ("0"):
                ZeroButton.PerformClick();
                break;

            case ("1"):
                OneButton.PerformClick();
                break;

            case ("2"):
                TwoButton.PerformClick();
                break;

            case ("3"):
                ThreeButton.PerformClick();
                break;

            case ("4"):
                FourButton.PerformClick();
                break;

            case ("5"):
                FiveButton.PerformClick();
                break;

            case ("6"):
                SixButton.PerformClick();
                break;

            case ("7"):
                SevenButton.PerformClick();
                break;

            case ("8"):
                EightButton.PerformClick();
                break;

            case ("9"):
                NineButton.PerformClick();
                break;

            case ("\r"):
                EqualsButton.PerformClick();
                break;

            case ("."):
                PointButton.PerformClick();
                break;

            case ("/"):
                DivideButton.PerformClick();
                break;

            case ("*"):
                TimesButton.PerformClick();
                break;

            case ("-"):
                MinusButton.PerformClick();
                break;

            case ("+"):
                PlusButton.PerformClick();
                break;
            }
        }
Beispiel #7
0
        void ReleaseDesignerOutlets()
        {
            if (CalculateButton != null)
            {
                CalculateButton.Dispose();
                CalculateButton = null;
            }

            if (DivideButton != null)
            {
                DivideButton.Dispose();
                DivideButton = null;
            }

            if (EightButton != null)
            {
                EightButton.Dispose();
                EightButton = null;
            }

            if (FiveButton != null)
            {
                FiveButton.Dispose();
                FiveButton = null;
            }

            if (FourButton != null)
            {
                FourButton.Dispose();
                FourButton = null;
            }

            if (MinusButton != null)
            {
                MinusButton.Dispose();
                MinusButton = null;
            }

            if (MultiplyButton != null)
            {
                MultiplyButton.Dispose();
                MultiplyButton = null;
            }

            if (NineButton != null)
            {
                NineButton.Dispose();
                NineButton = null;
            }

            if (OneButton != null)
            {
                OneButton.Dispose();
                OneButton = null;
            }

            if (PlusButton != null)
            {
                PlusButton.Dispose();
                PlusButton = null;
            }

            if (ResultBox != null)
            {
                ResultBox.Dispose();
                ResultBox = null;
            }

            if (SevenButton != null)
            {
                SevenButton.Dispose();
                SevenButton = null;
            }

            if (SixButton != null)
            {
                SixButton.Dispose();
                SixButton = null;
            }

            if (ThreeButton != null)
            {
                ThreeButton.Dispose();
                ThreeButton = null;
            }

            if (TwoButton != null)
            {
                TwoButton.Dispose();
                TwoButton = null;
            }

            if (ZeroButton != null)
            {
                ZeroButton.Dispose();
                ZeroButton = null;
            }
        }