private void newB_Click(object sender, EventArgs e) { newZbranDialog dialog = new newZbranDialog(); this.Hide(); if (dialog.ShowDialog(this) == DialogResult.OK) { UpdateTree(); //tree.SelectedNode = tree.Nodes.Find(dialog.jmeno, true)[0]; tree.Focus(); } this.Show(); }
private void editB_Click(object sender, EventArgs e) { if (tree.SelectedNode == null) { MessageBox.Show("Pro úpravu musíte vybrat zbraň ze seznamu.", "Vyberte zbraň", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } newZbranDialog dialog = new newZbranDialog(tree.SelectedNode.Text, selected); this.Hide(); if (dialog.ShowDialog(this) == DialogResult.OK) { UpdateTree(); //tree.SelectedNode = tree.Nodes.Find(dialog.jmeno, true)[0]; tree.Focus(); } this.Show(); }