Inheritance: System.Windows.Forms.Form
Exemplo n.º 1
0
        public static string InputBox(string prompt, string title, string defaultValue)
        {
            var ib = new InputBoxDialog {
                FormPrompt = prompt, FormCaption = title, DefaultValue = defaultValue
            };

            ib.ShowDialog();
            ib.Close();
            return(ib.InputResponse);
        }
Exemplo n.º 2
0
        private void BtnAddClick(object sender, EventArgs e)
        {
            string s = InputBoxDialog.InputBox("Enter the new value to add.", "New Bucket", "0.00");
            double res;

            if (double.TryParse(s, out res))
            {
                var item = new ListItem(res);
                if (!checkList.Items.Contains(item))
                {
                    checkList.Items.Add(item, true);
                    checkList.Sorted = true;
                }
            }
        }