Prevent layers from being added automatically

R

rusty.brackett

I have a .NET application that uses the Visio 2003 drawing control on a
WinForm. When ever certain shapes are dropped onto the drawing surface,
a layer will be automatically created and the shape will be put into
the layer automatically.

The shape I am seeing this with is the 'Transition' shape from the ROOM
stencil. The name of the layer is 'Connector'.

I would like to prevent the creation of the layer from happening if
possible. If not, then I would like to be able to detect when a layer
is added. I cannot find a 'LayerAdded' event, but from what I have read
it may be possible for me to create a custom event using AddAdvise. Is
this accurate? If not, is there another means to accomplish what I
want?

As always, any sample code is greatly appreciated.

Russell
 
A

Al Edlund

If the shapes are known ahead of time you might consider a custom stencil
without the offending layers included in the shapes. Another scenario is to
detect when the shape is added/dropped and then just remove it from all of
the layers, before adding it to the one you want.
Al
 

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