/// <summary> /// Updates the result panel and its contents. /// </summary> public void updateSize() { //Resultlist if (content is ResultList) { ResultList temp = content as ResultList; temp.setSize(this.Width, this.Height); } //Info display else if (content is InfoDisplay) { InfoDisplay temp = content as InfoDisplay; temp.setSize(this.Width, this.Height); } //News reader else if (content is NewsReader) { NewsReader temp = content as NewsReader; temp.setSize(this.Width, this.Height); } //Integrated news list else if (content is IntegratedNewsList) { IntegratedNewsList temp = content as IntegratedNewsList; temp.setSize(this.Width, this.Height); } //Sets size of result panel content.Width = this.Width; content.Height = this.Height; }
/// <summary> /// Sets size of the info display /// </summary> /// <param name="W"></param> /// <param name="H"></param> public void setSize(int W, int H) { this.Width = W; this.Height = H; chartPanel.Width = W - (Padding.Right * 2 + chartPanel.Margin.Right * 2); if (typeOfStock != "market") { chartPanel.Height = H / 3; } else { chartPanel.Height = H - H / 3; } //Set size of panel containing stock information stockInfoPanel.Height = 100; stockInfoPanel.Width = this.Width; //Set size of stock info labels stockInfoLabel.Width = stockInfoPanel.Width; stockNameLabel.Width = stockInfoPanel.Width; chart.Width = chartPanel.Width; chart.Height = chartPanel.Height; chartTypePanel.Width = (buttonWidth + lineChartButton.Margin.Left + lineChartButton.Margin.Right) * 3 + chartTypePanel.Padding.All; timeSpanPanel.Width = (buttonWidth + lineChartButton.Margin.Left + lineChartButton.Margin.Right) * 3 + timeSpanPanel.Padding.All; chartTypePanel.Height = (buttonHeight + lineChartButton.Margin.Top + lineChartButton.Margin.Bottom) + timeSpanPanel.Padding.All; timeSpanPanel.Height = (buttonHeight + lineChartButton.Margin.Top + lineChartButton.Margin.Bottom) + timeSpanPanel.Padding.All; centerChartType.Width = W; centerChartType.Height = chartTypePanel.Height; centerTimeSpan.Width = W; centerTimeSpan.Height = timeSpanPanel.Height; timeSpanFiller.Width = (this.Width / 2) - (timeSpanPanel.Width / 2); chartTypeFiller.Width = (this.Width / 2) - (chartTypePanel.Width / 2); //Set news panel size newsPanel.Width = W; newsPanel.Height = H - chartPanel.Height - timeSpanPanel.Height - chartTypePanel.Height - this.Margin.All - 130; newsPanel.Location = new Point((W - newsPanel.Width) / 2); news.setSize(W, newsPanel.Height); }