private void tvFinInstruments_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { try { string ident = tvFinInstruments.SelectedNode.Text; if (positions.FirstOrDefault(z => z.Ident == ident) != null) { ScalarAndTimeSeries form = new ScalarAndTimeSeries(ident); form.ShowDialog(); } } // If the file is not found, handle the exception and inform the user. catch (System.ComponentModel.Win32Exception) { MessageBox.Show("File not found."); } } }
private void tvFinInstruments_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Button == MouseButtons.Left) { try { string ident = e.Node.Text; if (positions.FirstOrDefault(z => z.Ident == ident) != null) { ScalarAndTimeSeries form = new ScalarAndTimeSeries(ident); form.ShowDialog(); } } // If the file is not found, handle the exception and inform the user. catch (System.ComponentModel.Win32Exception) { MessageBox.Show("File not found."); } } }