private void MenuItemClickHandler(object sender, EventArgs e) { ChartControl chartControl = new ChartControl(); ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender; chartControl.Symbol = clickedItem.Text; frm_chart newMDIchild = new frm_chart(chartControl); newMDIchild.MdiParent = this; newMDIchild.Show(); }
private void frm_mainForm_Load(object sender, EventArgs e) { BuildMenuItems(); this.Text = User.curName + ", " + User.curUsername; toolStripStatusLabel_date.Text = DateTime.Now.ToLongDateString(); toolStripStatusLabel_connection.Text = "Not connected"; toolStripStatusLabel_connection.Image = Properties.Resources.conLOST; isConnected = false; ArrayList quoteList = DataBase.getUsersQuoteList(User.curUsername); foreach (String quote in quoteList) { Quotes.Add(quote, new Candle()); } frm_LiveQuotes newMDIchild = new frm_LiveQuotes(); newMDIchild.MdiParent = this; newMDIchild.Show(); frm_LiveNews newMDIchild2 = new frm_LiveNews(); newMDIchild2.MdiParent = this; newMDIchild2.Show(); frm_Alerts newMDIchild3 = new frm_Alerts(); newMDIchild3.MdiParent = this; newMDIchild3.Show(); alertsToolStripMenuItem.Enabled = false; liveQuotesToolStripMenuItem.Enabled = false; newsToolStripMenuItem.Enabled = false; ArrayList DefaultChartList = DataBase.getDefaultChartList(); foreach (String symbol in DefaultChartList) { ChartControl chartControl = new ChartControl(); chartControl.Symbol = symbol; frm_chart newMDIchild4 = new frm_chart(chartControl); newMDIchild4.MdiParent = this; newMDIchild4.Show(); } this.LayoutMdi(System.Windows.Forms.MdiLayout.TileVertical); }
void openChart_Click(object sender, EventArgs e) { MenuItem mi = (MenuItem)sender; ChartControl chartControl = new ChartControl(); chartControl.Online = true; chartControl.Symbol = mi.Tag.ToString(); chartControl.Exchange = ""; chartControl.Interval = 60; chartControl.Period = "1d"; frm_chart newMDIchild = new frm_chart(chartControl); newMDIchild.MdiParent = this.MdiParent; newMDIchild.Show(); }