private void btnOk_Click(object sender, EventArgs e) { ListView listView = _tabs[tabControl.SelectedTab.Text]; if (listView.SelectedItems.Count > 0) { Node = (NodeLibraryManager.NodeLibraryType)listView.SelectedItems[0].Tag; DialogResult = DialogResult.OK; Close(); } else { MessageBox.Show(this, CANAPE.Properties.Resources.SelectLibraryNodeForm_SelectNode, CANAPE.Properties.Resources.MessageBox_ErrorString, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void listViewNodes_MouseDoubleClick(object sender, MouseEventArgs e) { ListView listView = (ListView)sender; if (listView.SelectedItems.Count > 0) { Node = (NodeLibraryManager.NodeLibraryType)listView.SelectedItems[0].Tag; DialogResult = DialogResult.OK; Close(); } }