public static string ShowMedium(string title, string label) { OneLineInputForm olif = new OneLineInputForm(title, label, OneLineInputSize.Medium); if (olif.ShowDialog() == DialogResult.OK) { return(olif.InputLine); } else { return(null); } }
private void ClassComboBox_SelectionChangeCommitted(object sender, System.EventArgs e) { if (ClassComboBox.Text == "New class...") { OneLineInputForm olif = new OneLineInputForm("Add new user category", "New category name", OneLineInputSize.Medium); string newClassName = OneLineInputForm.ShowMedium("Add new user category", "New category name"); if (newClassName != null && newClassName != "") { ClassComboBox.Items.Add(newClassName); ClassComboBox.SelectedItem = newClassName; MOG_UserCategory muc = new MOG_UserCategory(); muc.mCategoryName = newClassName; this.mog.GetProject().UserCategoryAdd(muc); } } }