예제 #1
0
        /// <summary>
        /// Gets value from customized numeric dialog box.
        /// </summary>
        /// <param name="minimum">Integer lower bound value.</param>
        /// <param name="maximum">Integer upper bound value.</param>
        /// <param name="value">Referenced integer to set value to.</param>
        /// <param name="increment">Integer numericUpDown step value.</param>
        /// <param name="title">String value represents title of dialog box.</param>
        /// <param name="description">String value represents description, showed above numericUpDown control.</param>
        /// <returns>Boolean value 'true' if user submited value, 'false' - if canceled.</returns>
        public static bool GetValue(int minimum, int maximum, ref int value, int increment, string title, string description)
        {
            NumericDialog dialog = new NumericDialog(minimum, maximum, increment, title, description);

            dialog.Value = value;
            DialogResult dRes = dialog.ShowDialog();

            if (dRes == DialogResult.OK)
            {
                value = dialog.Value;
            }

            return(dRes == DialogResult.OK);
        }
예제 #2
0
        /// <summary>
        /// Gets value from customized numeric dialog box.
        /// </summary>
        /// <param name="minimum">Integer lower bound value.</param>
        /// <param name="maximum">Integer upper bound value.</param>
        /// <param name="value">Referenced integer to set value to.</param>
        /// <param name="increment">Integer numericUpDown step value.</param>
        /// <param name="title">String value represents title of dialog box.</param>
        /// <param name="description">String value represents description, showed above numericUpDown control.</param>
        /// <returns>Boolean value 'true' if user submited value, 'false' - if canceled.</returns>
        public static bool GetValue(int minimum, int maximum, ref int value, int increment, string title, string description)
        {
            NumericDialog dialog = new NumericDialog(minimum, maximum, increment, title, description);
            dialog.Value = value;
            DialogResult dRes = dialog.ShowDialog();

            if (dRes == DialogResult.OK)
            {
                value = dialog.Value;
            }

            return dRes == DialogResult.OK;
        }