Make a Chart With Textbox Values and Print It

Category:
Forms and Controls
Type:
Snippets
Difficulty:
Beginning
Author:
Patrick Lockefeer

Version Compatibility: Visual Basic 6

More information:
A good introduction to creating charts in VB. Add the following controls to your form as well as a menu. Once you run the application, the chart is drawn with default values when the form loads. Enter values in the Textboxes, click Show Chart and the MSChart control gets updated. You can print the chart as needed from the File menu. 'Add the MsChart Control to your Form >> Components >> Microsoft Chart Control 6.o (Sp4) 'Controls on your Form : '5 TextBoxes Names : Text1 to Text5 'CommandButton Name : Command1 Caption : Show Chart 'MsChart Name : MsChart1 'MsChart1 property ChartType : 1-VtChChartType2dBar 'Create a small Menu with Name : File and Submenu Name : mnuPrintChart

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: