private void loadDefaultsToolStripMenuItem_Click(object sender, EventArgs e) { using (StreamReader defaultsReader = new StreamReader("../defaults.dat")) { string line; string[] vals; while ((line = defaultsReader.ReadLine()) != null) { vals = line.Split(','); foreach (string val in vals) { try { string symbol = val.ToUpper(); stockData stock = new stockData(); Form NewMdiChild = new graph_frame(stock.getData(symbol), symbol); NewMdiChild.MdiParent = this; NewMdiChild.Text = symbol + this.MdiChildren.Count(); NewMdiChild.Show(); } catch (NotSupportedException) { MessageBox.Show("Not Supported Exception"); } catch (FileNotFoundException) { MessageBox.Show("File Not Found Exception"); } } } } this.LayoutMdi(System.Windows.Forms.MdiLayout.TileHorizontal); }
private void goButton_Click(object sender, EventArgs e) { try { string symbol = symbolTextBox.Text.ToUpper(); stockData stock = new stockData(); Form NewMdiChild = new graph_frame(stock.getData(symbol), symbol); NewMdiChild.MdiParent = this; NewMdiChild.Text = symbol + this.MdiChildren.Count(); NewMdiChild.Show(); } catch (NotSupportedException) { MessageBox.Show("Sorry, couldn't locate that symbol. Please try another one."); } catch (FileNotFoundException) { MessageBox.Show("Sorry, couldn't locate that symbol. Please try another one."); } }