Drawing Shapes

N

news.micrsoft.com

Thanks for your last post! That helpped out!

I wrote a function in C# to do this layout. Quick questions it seems like I
have to run this code everytime I add a new shape to the page? Is there a
way to set it so I do it once and done. Since it deals with page properies
it doesnt seem like I should be running it everytime I drop a cloud on the
page.

Second. I have noticed that the cloud is more complex then other shapes. By
default clouds seem to have subshapes under ItemFormID( # ). I want to get
ride of all the subshapes and make the background white so that I just have
a plan white cloud outline. I can do this fine for the first cloud cause I
know it will be ItemFormID( 6 through 2 ) but then I place some other non
cloud objects and then when I place the next cloud I have no idea what the
form ID is so I cant delete all it subshapes and change its color.

Third, after I have placed a cloud on the page, I want to place some smaller
object inside the cloud. How can I ensure that an object will be place
exactly inside a cloud? Right now i'm just randomly placing them on the
page..sometimes there in the cloud and sometimes not. Is there some property
I can use to add shapes to another shape, like added shapes to a cloud?

I know this is a lot, but thanks in advance.
bourdett
 
M

Mark Nelson [MS]

I recommend reading through the Developing Microsoft Visio Solutions book
that is included with the Visio SDK. You need to understand about shapes
and their shapesheet formulas to correctly position them.

To give you some general answers to your questions:
- Layout has to be invoked each time, though you can restrict it to a
selection of shapes rather than the whole page.
- You should not depend on Shape.IDs to identify shapes. They will change.
Often people create a User-Defined cell with a specific value to identify
shapes.
- Generally, you can use the alignment boxes of shapes to position them
relative to other shapes. The width and height of each shape creates an
alignment rectangle. You should be able to place your subshapes within the
cloud's alignment rectangle.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top