private void addLinkBtn_Click(object sender, EventArgs e) { string link = AddNodePrompt.ShowDialog("Enter a link", "Web Address"); if (link != string.Empty) { mainRichTextBox.InsertLink(mainRichTextBox.SelectedText, link, mainRichTextBox.SelectionStart); } }
private void addNodeBtn_Click(object sender, EventArgs e) { if (treeView.SelectedNode.Name == "homeNode") { MessageBox.Show("Cannot add node to homepage"); } else { newNodeName = AddNodePrompt.ShowDialog("Choose a Name", "Node Name"); SearchAndAddNode(treeView.SelectedNode.Name, newNodeName); treeView.SelectedNode = FindNode(newNodeName, treeView.SelectedNode.Name); } }