public void editB_Click(object sender, LinkLabelLinkClickedEventArgs args) { newKombinace dialog = new newKombinace(mgr.postava, this); if (dialog.ShowDialog(Program.getMainForm()) == DialogResult.OK) { Postava postava = mgr.postava; nazev = dialog.nazevKomba.Text; zbran = dialog.zJmeno; Calculate(); } }
public void newKombinaceB_LinkClicked(object sender, EventArgs e) { if (kombinaceList.Count >= 6) { MessageBox.Show("Pro rychlejší chod programu je maximální počet kombinací 6.", "Maximum kombinací", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } newKombinace dialog = new newKombinace(postava); Main form = Program.getMainForm(); if (dialog.ShowDialog(form) == DialogResult.OK) { if (dialog.r1.Checked == true) { String nazev; String zbran; String stit; nazev = dialog.nazevKomba.Text; zbran = dialog.zJmeno; stit = dialog.sJmeno; kombinaceList.Add(new Kombinace(this, flowPanel, nazev, zbran, stit, dialog.checkBox1.Checked)); } else { String nazev; String zbran; nazev = dialog.nazevKomba.Text; zbran = dialog.zJmeno; strelneList.Add(new Strelna(this, flowPanel, nazev, zbran)); } UpdateAll(); Program.getMainForm().setPohyb(postava); } }