private void editSpellsButton_Click(object sender, EventArgs e) { if (esf.IsDisposed == true) // Create new form if opened and closed before { esf = new EditSpellsForm(); } esf.ShowDialog(); }
public StatBlockForm() { InitializeComponent(); esf = new EditSpellsForm(); esf.updateStatBlockForm += updateSpellsListView; etf = new EditTraitsForm(); etf.updateStatBlockForm += updateTraitsListView; // Name Text Box nameBox.Text = "Creature Name"; nameBox.ForeColor = Color.Gray; this.nameBox.Leave += new System.EventHandler(this.nameBox_Leave); this.nameBox.Enter += new System.EventHandler(this.nameBox_Enter); // Race Text Box raceTypeBox.Text = "Race (optional)"; raceTypeBox.ForeColor = Color.Gray; this.raceTypeBox.Leave += new System.EventHandler(this.raceTypeBox_Leave); this.raceTypeBox.Enter += new System.EventHandler(this.raceTypeBox_Enter); // Natural Armor Text Box armorTypeBox.Text = "Natural Armor"; armorTypeBox.ForeColor = Color.Gray; this.armorTypeBox.Leave += new System.EventHandler(this.armorTypeBox_Leave); this.armorTypeBox.Enter += new System.EventHandler(this.armorTypeBox_Enter); sizeBox.Text = "Medium"; typeBox.Text = "Humanoid"; alignmentBox.Text = "Unaligned"; hpCalcBox.Text = "Average"; crBox.Text = "0"; tmTypeBox.Text = "Resistances"; pbBox.Text = "+2"; spellAttrBox.Text = "Intelligence"; // Visually display that the spellcasting feature is disabled by default saLabel.ForeColor = Color.Gray; spellSaveDcLabel.ForeColor = Color.Gray; spellAttackLabel.ForeColor = Color.Gray; }