I am trying to view the graphs on a typical laptop resolution (i.e. 1024x768 pixels). When I view the graphs, they do not fit on the screen and have to be resized to view properly. Can anyone suggest a solution to this problem, Thanks
The graphs are placed on a .Net Form and are positioned and sized with respect to that form. The .Net Form does not automatically resize when the screen resolution changes. If you want the Form and graph to size proportionate to the screen resolution then you must explicitly resize them. The Screen property of the Form class gives you access to the display resolution. You can resize the Form and graphs using code similar to the below, which is a modified version of our ChartOfTheWeek12-31-03 example program:
public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); Rectangle screenbounds = Screen.GetBounds(this); this.Width = screenbounds.Width; this.Height = screenbounds.Height;
// chartOfTheWeek1 is some ChartView derived class that displayes the graph chartOfTheWeek1.InitializeChart(); chartOfTheWeek1.Size = new Size(screenbounds.Width, screenbounds.Height);
// // TODO: Add any constructor code after InitializeComponent call // }