Exemplo n.º 1
0
        public static bool Show(string title,
                                string defaultName, int defaultValue,
                                out string name, out int?integer, bool bHideNameInputBox = false)
        {
            IntInputBox form = new IntInputBox(title);

            form.bHideNameInputBox = bHideNameInputBox;
            if (bHideNameInputBox)
            {
                form.nameBox.Visible    = false;
                form.label_name.Visible = false;
            }

            // Set default value
            if (defaultName != null)
            {
                form.nameBox.Text = defaultName;
            }
            if (defaultValue != 0)
            {
                form.valueBox.Value = defaultValue;
            }

            bool result = form.ShowDialog() == DialogResult.OK;

            name    = form.nameResult;
            integer = form.intResult;
            return(result);
        }
Exemplo n.º 2
0
        public static bool Show(string title, out string name, out int?integer)
        {
            IntInputBox form   = new IntInputBox(title);
            bool        result = form.ShowDialog() == DialogResult.OK;

            name    = form.nameResult;
            integer = form.intResult;
            return(result);
        }