Example #1
0
        public static void UpdateFromButton(object sender)
        {
            if (!(sender is Button))
            {
                return;
            }


            Button button = sender as Button;

            if (!(button.Tag is Control))
            {
                return;
            }

            Control control = button.Tag as Control;

            NumericInputForm form = new NumericInputForm();

            form.NumberEntered = int.Parse(control.Text);

            if (form.ShowDialog() == DialogResult.OK)
            {
                control.Text = form.NumberEntered + "";
            }
        }
Example #2
0
 private void ButtonNumericInput_Click(object sender, EventArgs args)
 {
     NumericInputForm.UpdateFromButton(sender);
 }