private void RequirementDialogClass_Load(object sender, EventArgs e) { //AllowEvents = false; //Lets create our category List and add it to the combobox CategoryNames = TableNamesModel.GetNamesByRequirementUsage(true); foreach (string name in CategoryNames) { comboCategory.Items.Add(name); } if (isNewRecord == true) { comboCategory.SelectedIndex = -1; buttonOk.Enabled = false; } else { comboCategory.SelectedItem = GetCategoryName(SelectedRequirementId); if (comboTree.Visible == true) { comboTree.SelectedItem = GetTreeName(SelectedRequirementId); } if (comboSlot.Visible == true) { comboSlot.SelectedItem = BuildSlotName(GetSlotModel(RequirementId)); } Debug.WriteLine("ApplytoValue " + GetApplyToName(SelectedRequirementId)); comboApplyTo.SelectedItem = GetApplyToName(SelectedRequirementId); } comboComparison.SelectedItem = SelectedComparison.ToString(); numberValue.Value = (decimal)SelectedRequirementValue; checkboxRequiresAll.Checked = SelectedRequiresAll; AllowEvents = true; }
public NewRequirementDialogClass() { InitializeComponent(); DefaultWidth = 240; DefaultHeight = 240; //Lets hide these controls until the user needs them TreeLabel.Visible = false; TreeComboBox.Visible = false; SlotLabel.Visible = false; SlotComboBox.Visible = false; //Resize our form now this.Size = new Size(DefaultWidth, DefaultHeight); //lets create our Category List and add it to the CategoryComboBox CategoryNames = TableNamesModel.GetNamesByRequirementUsage(true); CategoryNames.Remove("Character"); foreach (string name in CategoryNames) { CategoryComboBox.Items.Add(name); } ApplyToNames = new List <string>(); TreeNames = new List <string>(); this.NewRequirementId = Guid.Empty; }