<< Click to Display Table of Contents >> NShape Programmer Tasks
|
When a program changes the color of a shape template, all shapes that belong to this template will be affected (unless their fill style has been detached from the template).
Standard fill styles are available as properties in the Design class. You must make sure that the shape and therefore its template shape have indeed a FillStyle property, e.g. because they implement IPlanarShape.
((IPlanarShape)myShape.Template.Shape).FillStyle = myProject.Design.FillStyles.Blue; |
Custom fill styes and standard fill styles can also be identified by their name. Make sure to use the name of a style not its title, which is for display purposes only and not necessarily unique:
((IPlanarShape)myShape.Template.Shape).FillStyle = myProject.Design.FillStyles["myCustomFillStyle"]; |
When you set the shape's fill style to null, it uses its template's fill style again:
myShape.FillStyle = null; |