private void FormSupplyEdit_Load(object sender, EventArgs e) { textSupplier.Text = Suppliers.GetName(ListSupplier, Supp.SupplierNum); SuppOriginal = Supp.Copy(); for (int i = 0; i < DefC.Short[(int)DefCat.SupplyCats].Length; i++) { comboCategory.Items.Add(DefC.Short[(int)DefCat.SupplyCats][i].ItemName); if (Supp.Category == DefC.Short[(int)DefCat.SupplyCats][i].DefNum) { comboCategory.SelectedIndex = i; } } if (comboCategory.SelectedIndex == -1) { comboCategory.SelectedIndex = 0; //There are no hidden cats, and presence of cats is checked before allowing user to add new. } categoryInitialVal = Supp.Category; textCatalogNumber.Text = Supp.CatalogNumber; textDescript.Text = Supp.Descript; if (Supp.LevelDesired != 0) { textLevelDesired.Text = Supp.LevelDesired.ToString(); } if (Supp.Price != 0) { textPrice.Text = Supp.Price.ToString("n"); } checkIsHidden.Checked = Supp.IsHidden; isHiddenInitialVal = Supp.IsHidden; }