Change colors dinamically to show different states

Aug 2, 2012 at 3:34 PM

Hi,

i'm considering show a diagram with custom shapes or standard and in function of some conditions i would like change the fill color of one of them, to create a blink effect, dinamically .... i tried something like this:

            foreach (Shape sh in display1.Diagram.Shapes)
            {
 
                if (sh.Type.ToString() != "GeneralShapes.Text" && sh.Type.ToString() != "GeneralShapes.Polyline")
                {
                    Circle circ = (Circle)sh;
  
 
                    MessageBox.Show(circ.Text );
                }
            }

but i've not access to change the shape's color, no possible also casting to circle .....

 

Am i following the right way ?

Thank's in advance!

Coordinator
Aug 3, 2012 at 7:11 AM
Edited Aug 3, 2012 at 7:11 AM

You cannot access the color of the shapes directly, this is done by setting an other FillStye:

foreach (Shape sh in display1.Diagram.Shapes)
{
    if (sh is Dataweb.NShape.Advanced.TextBase || sh is Dataweb.NShape.ILinearShape) 
        continue; 
    Circle circ = (Circle)sh; 
    circ.FillStyle = project1.Design.FillStyles["Red"]; 
}






Aug 3, 2012 at 8:08 AM

Thank's kurtholzinger !!