I have a graphics layer where I add several graphics. Some times the graphics are very close and there are some I would like to bring to the front so the client can have a better view of them. Is there any way to do that programmatically? I did not see anything in the API. Thanks!
Never mind. I think I got it. What I did was to set the Z-index to 0 in all the graphics I have when I instantiate them to make sure they are all at the lowest level. When I need to show them on top of the others I set the z-index to a high number and they show the way I want. I can re-set them to zero if I want them back at the level they were first. Thanks for your help!
Jennifer, thanks for your reply. I tried the z order which I thought was a the fastest procedure and did not get good results. Not sure why. I got the count of graphics that I had at the specific moment in the layer so it would be the highest number possible and set the z index with that and still they were overlapping. I also tried using this:
Graphics.Move(Graphics.IndexOf(myGraphic), 0);
That does the trick when I do one by one; but if I do several at the same time the graphics disappear from the screen for an instance. That tells me that likely the "move" algorithm is more time consuming (and I think that make sense). So, any advice with the z-index? Is that the right way to use it? I'd like to use that approach if possible so the graphics don't flicker like that.
Never mind. I think I got it. What I did was to set the Z-index to 0 in all the graphics I have when I instantiate them to make sure they are all at the lowest level. When I need to show them on top of the others I set the z-index to a high number and they show the way I want. I can re-set them to zero if I want them back at the level they were first. Thanks for your help!