<< Click to Display Table of Contents >> NShape Programmer Tasks
|
Shape colors can be modified in the design either by modifying the respective color style or the fill style of the shape. Modifying the color style replaces this color with new one everywhere in the project. Modifying the fill style in the design affects all templates, shapes and other objects that refer to this style. Note that you cannot modify a style that you access from a shape, because IPlanarShape.FillStyle returns a read-only style interface.
Identify the fill style used in the shape, fetch it from the design and assign it a different BaseColorStyle:
myProject.Design.FillStyles[myShape.FillStyle.Name].BaseColorStyle = myProject.Design.ColorStyles.Green; |
Identify the color style used in the shape's fill style, fetch it from the design and assign it a different color:
myProject.Design.ColorStyles[myShape.FillStyle.BaseColorStyle.Name].Color = Color.LightGreen; |