Terrygordon
asked on
Loop through multiple charts on a form in vb express
Hi all
I have a form with several chart objects (Chart1, Chart2, Chart3, etc.). The charts are created at runtime (currently using a with statement to define numerous properties of the chart).
At the minute I am using:
With Chart1
List of properties
With Chart2
List of properties
Etc.
However, as all the charts have multiple properties in common, I wondered if it was possible to loop through every chart on the form and set these common properties? This would drastically reduce the amount of code.
I've played around with trying to assign variable names to the charts and using 'Do' for each control on the form that is a chart, but my programming skills are pretty basic, and there is always something that VB doesn't like.
Regards
Terry
I have a form with several chart objects (Chart1, Chart2, Chart3, etc.). The charts are created at runtime (currently using a with statement to define numerous properties of the chart).
At the minute I am using:
With Chart1
List of properties
With Chart2
List of properties
Etc.
However, as all the charts have multiple properties in common, I wondered if it was possible to loop through every chart on the form and set these common properties? This would drastically reduce the amount of code.
I've played around with trying to assign variable names to the charts and using 'Do' for each control on the form that is a chart, but my programming skills are pretty basic, and there is always something that VB doesn't like.
Regards
Terry
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Brilliant. It works perfectly.
Regards
Terry