Automated proportional resizing for multiple controls?

One aspect of resizing I’ve had to programmatically roll myself over the years is “proportional” resizing of side-by-side control groups / text fields.

For example: in a simple example window, you have two size-by-side editable text fields, each with a label to the left of the field:

 label #1: EDITABLE TEXT FIELD #1     label #2:  EDITABLE TEXT FIELD #2

…so four items: two labels, and to editable text fields. All with the same vertical positions.

When the window is resized (larger, for example), I want both text fields to get wider, ideally:

  1. When editable text field #1’s right edge resizes to be wider, the left edge of label #2 needs to be pushed to the right. And of course, the left edge of Editable Text Field #2 needs to move that same distance so that label #2 maintains its correct distance.

  2. ALSO in this example – the right edge of Editable Text Field #2 needs to grow, too.

  3. Ideally, in addition to setting min & max widths, I’d like to control how much the two fields grow in response to resizing. For example, I might want to favor Editable Text Field #2, allowing it to grow at twice the rate of Editable Text Field #1.

As I’ve said, it can be done programmatically(I’m guessing through the Window’s Resizing / Resized event). But if there’s a better solution that can be applied at design time, It would be great to know before I create a hundred different layouts.

If you are looking for the easiest solution consider Rubber Views

Wow! Thanks! Holy scaling and resizing, batman! That’s something else! I’ll experiment with it!

Stephen

+1 for Rubber Views