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); }
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; } } }