In this section, we will provide step by steps instructions on how to use ChartDirector in a Visual Basic project from scratch. After following these steps, you should create a VB project the same as the sample VB project in "[ChartDirector]\vbHelloWorld".
- Install the ChartViewer control in the VB Toolbox.
Right click in any empty location in the VB Toolbox, and select Component. Select "ChartDirector ChartViewer" from the component lists, and press OK.
If you could not find "ChartDirector ChartViewer" from the component list, you may press the "Browse" button, and browse to "[system32]\chartviewer.ocx" and select it.
After the above step, you should see the ChartViewer control appear in the VB Toolbox.
- Add a reference to ChartDirector in the VB project. This is by selecting Project/Reference in the VB IDE, then checked the box "ChartDirector".
- Put an instance of the ChartViewer control on a Form.
- Cut and paste the following code into the Form_Load method of the Form.
Note that the above code is the same as that in the previous section The First Windows Project, except the variable "viewer" is replaced with the actual name of the control "ChartViewer1". Please refer to the previous version for detail explanation of the code.