Here is a demo. You can use it to see how things could be done and then do something similar in your application. The demo does two things:
- object sizes are consistent while you resize the window
- the 2 red objects are locked at the left and right edges