private void customSkillDeleted(object sender, EventArgs e) { customSkillRow send = (customSkillRow)sender; send.deleteControls(tabSkills); customSkillsNumber--; }
private void addSkillButton_Click(object sender, EventArgs e) { var temp = new customSkillRow("CustomSkill" + customSkillsNumber.ToString(), new Point(300, customSkillsNumber * 20), tabSkills); temp.customSkillDeleted += customSkillDeleted; allRows.Add(temp); addSkillButton.Top += 20; customSkillsNumber++; }
public Form1() { InitializeComponent(); setupAttributes(); setupSkills(); void setupAttributes() { var offset = 0; foreach (string Attr in AttributeNames) { allRows.Add(new abilityRow(Attr, new Point(0, offset), tabAbilities)); offset += 20; } } void setupSkills() { var offset = 0; foreach (string Skill in SkillNames) { allRows.Add(new skillRow(Skill, new Point(0, offset), tabSkills)); offset += 20; } offset = 0; foreach (string Skill in CustomSkillNames) { var temp = new customSkillRow(Skill, new Point(300, offset), tabSkills); temp.customSkillDeleted += customSkillDeleted; allRows.Add(temp); customSkillsNumber++; offset += 20; } addSkillButton.Location = new Point(300, offset); } }