Shape always on top?

J

justward

Is there a way (perhaps in the shapesheet) to make a symbol be "always
on top" of any other symbols in the drawing?
 
P

Paul Herber

Is there a way (perhaps in the shapesheet) to make a symbol be "always
on top" of any other symbols in the drawing?

not in the shapesheet, but

manually, from the menu
Shape | Bring to Front

or in code
shape.BringToFront
 
J

Justin Ward

Paul,
Thanks for the response, but let me clarify... I need the shape to always be
on top of everything else. If I drop a new symbol into the drawing, I need
the pre-exisiting shape to stay on top, in spite of the new symbol that i
added.
 
P

Paul Herber

On Fri, 30 Mar 2007 10:34:00 -0700, Justin Ward <Justin
Paul,
Thanks for the response, but let me clarify... I need the shape to always be
on top of everything else. If I drop a new symbol into the drawing, I need
the pre-exisiting shape to stay on top, in spite of the new symbol that i
added.

I don't think there is a simple way to do that. Normally, a new shape
would need to be on top so that it can be seen, selected and edited.

One option might be to write a Visio add-on that used the ShapeAdded
event to reduce the Z-order of any added shape (except for your one
special shape).
How to write a Visio add-on is explained in detail in the Visio SDK.
 
C

Chris Roth [MVP]

Hey JW,

Another option would be using foreground and background pages. In this case,
your "main page" would actually need to be a background of your "special
page". You would assign the "main page" to be a background of "special
page" -- everything that is drawin on "special page" will be in front of
"main page".

All of this is done by right-clicking the page tabs at the bottom of a
window, and also via File > Page Setup > Page Properties.

Not super-elegant, but it might work for what you need to do.

--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/
 
M

Michel LAPLANE

Hello guy's

I'm sorry but i have a simpler solution.
Catch the OnShapeAdded event (VBA or addin or VDC) on your shape and use
the method "SendToBack" : myShape.SendToBack.

Am i wrong or is there a chance that i might be a genius ?

Chris Roth said:
Hey JW,

Another option would be using foreground and background pages. In this
case, your "main page" would actually need to be a background of your
"special page". You would assign the "main page" to be a background of
"special page" -- everything that is drawin on "special page" will be in
front of "main page".

All of this is done by right-clicking the page tabs at the bottom of a
window, and also via File > Page Setup > Page Properties.

Not super-elegant, but it might work for what you need to do.

--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/
 
D

David Parker

Michel,
Good to see that you are still a very humble gent!
I use a similar event to to your suggestion, but, of course, the last shape
added may not be the one you need to keep on top, so you probably need to
hold a collection of shapes that always need to be on top, so that you just
bring them to front whenever anything else is added.
If this collection needs to be persisted between Visio sessions, then you
could use a custom cell value, or a a layer (sounds best), or a SoultionXML
section.

Michel LAPLANE said:
Hello guy's

I'm sorry but i have a simpler solution.
Catch the OnShapeAdded event (VBA or addin or VDC) on your shape and
use the method "SendToBack" : myShape.SendToBack.

Am i wrong or is there a chance that i might be a genius ?
 
M

Michel LAPLANE

David,

Thank you for your answer.
I think i must work and learn a bit more.
 
P

Paul Herber

On Fri, 30 Mar 2007 10:34:00 -0700, Justin Ward <Justin
Paul,
Thanks for the response, but let me clarify... I need the shape to always be
on top of everything else. If I drop a new symbol into the drawing, I need
the pre-exisiting shape to stay on top, in spite of the new symbol that i
added.

I've finally got around to looking at this, I've written an addon that
can keep shapes on top.
http://www.mezzo-for-visio.sandrila.co.uk/
 

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