Answered by:
Shapes on top of shapes

Question
-
I have a series of shapes that represent the walls of a building.
I need to place shapes over them to represent the doors etc in the building.
I draw all the shapes first and colour them to match the building texture and colours.
When I add the opening shape it will only appear in front of the first shape I drew then goes behing the rest.
Is there a way of keeping a shape in front like zorder in VB6.
Thanks for any help.
Mac
Mac
- Moved by Ryan MoldenMicrosoft employee Wednesday, June 27, 2012 2:34 PM Nothing to do with extensibility, moving to VB forum due to mention of VB6 (though the actual language being used in the question was never mentioned) (From:Visual Studio Extensibility)
Wednesday, June 27, 2012 4:43 AM
Answers
-
Problem Solved
The shapes will layer themselves in the order they were created not the order they are loaded at runtime.
I have deleted some shapes and then recreated them and now they appear as they should.
Mac
Mac
- Proposed as answer by Mark Liu-lxf Thursday, June 28, 2012 3:07 AM
- Marked as answer by Mark Liu-lxf Wednesday, July 4, 2012 9:26 AM
Thursday, June 28, 2012 1:28 AM
All replies
-
I have a series of shapes that represent the walls of a building.
This was posted in a VB Express Edition Forum
Language VB 2010 Express Edition
I need to place shapes over them to represent the doors etc in the building.
I draw all the shapes first and colour them to match the building texture and colours.
When I add the opening shape it will only appear in front of the first shape I drew then goes behing the rest.
Is there a way of keeping a shape in front like zorder in VB6.
Thanks for any help.
Mac
Mac
Wednesday, June 27, 2012 9:08 PM -
Problem Solved
The shapes will layer themselves in the order they were created not the order they are loaded at runtime.
I have deleted some shapes and then recreated them and now they appear as they should.
Mac
Mac
- Proposed as answer by Mark Liu-lxf Thursday, June 28, 2012 3:07 AM
- Marked as answer by Mark Liu-lxf Wednesday, July 4, 2012 9:26 AM
Thursday, June 28, 2012 1:28 AM -
You should not rely on the default ordering of the shapes. Each shape object should be an instance of a class that contains all the information needed to correctly render that shape. In your case, that includes an order (or layer) value. You can assign a default for that value using the order in which they were created, but it is then used to explicitly control the sequence used for rendering. You will need to add a utility to change the layer value for a shape, in case the user changes their mind or, as in your example, if the shapes are being recovered from some other source, such as a temporary store, where the order in which they are retrieved cannot be controlled.Thursday, June 28, 2012 2:02 AM