New topic, split from post by: david (http://visguy.com/vgforum/index.php?action=profile;u=85)
I have a group of two lines. In some cases I want the first line to hide the second line (to be in front of it) and in other cases I want the other line to be in front. What's the command for doing that (in the ShapeSheet not VBA)?
Answer from vojo (http://visguy.com/vgforum/index.php?action=profile;u=3):
Probably easiest way is to have an action button (and marker) set a variable to indicate which
line to hide (either has nolines = true vs false in the geometry...or...set transparency to 100% to
hide the given line. Ie set one line or the other as 100% transparent....or....you could get slick and
the line you want to hide set the begin and end to the same values, I think will work).
You can allow the user to "Bring to Front" or "Send to Back" using the DoCmd function, a proper id, and a right-click Action or Double-click event.
Technically, you can't control z-order via the ShapeSheet, but with clever tricks, you might be able to get bring-to-front and send-to-back to fire (via DoCmd) in reaction to changes in ShapeSheet data. The thing is, these z-order operations operate on selected shapes, so if your shape's data changes when the shape isn't selected, you won't get the desired results.
Ie: it's "slightly" possible, but probably won't be dependable.
There is one trick:
If one of the line will be usual memeber of the group and other line will be created in Geometry section of group shape you can use DisplayMode in Goup Properties section of ShapeSheet for changing Z-order.
(Sorry my English)
That's a really cool tip, zhuravsky!
using the docmd only works as "push to back" A shape cannot do a docmd that affects another shape (bring other to front) and since the only way to select this shape is that its in the front already.
The group level geometry and subshape geometry is a good idea.