Hi Richard,
This is a "feature" of "DrawObject" vs. "DragObject" controls.
- DrawObject = Rectangle, RoundRectangle, Oval, and Line.
- DragObject = All other controls
Same behavior in Window painter, UserObject painter, and at runtime (just checked in PB 2017 R2).
Potential workarounds:
- Select your rectangle using the "Control List" panel in the Window painter. Rectangle is still behind the picture, but now you have selected it if that is your only concern.
- Use a DataWindow object for that UI surface area. Rectangles etc. in a DataWindow are integral parts of the DW object and can be located anywhere in Z-order.
- Create a Custom Visual User Object containing a rectangle. Define a custom event mapped to PBM_Size to keep the rectangle filling the complete UI area.
- This works because your not really placing a DrawObject on the Window. Instead, you place a DragObject (your custom visual) which contains a DragObject.
Personally I prefer to design as much UI surface as possible using DataWindow objects.
HTH /Michael