If you don't have a maximum value, create 2 variables.
1) startvalue = (Box.width + Box.Height /4)
needs to be calculated when the box is created.
2) currentvalue = startvalue - ((Box.width + Box.Height /4) - startvalue)
needs to be calculated whenever the box increases its size. Thi is the value to be shown in the text box.
Example:
at start of layout the box is created with 50, 50
startvalue = 50 + 50 / 4 = 50 + 12.5 = 62.5
the box grows by 10 pixel in width
currentvalue = 62.5 - ((60 + 50 / 4) - 62.5) = 62.5 - (72.5 - 62.5) = 62.5 - 10 = 52.5
box grows again by 10 pixel im height
currentvalue = 62.5 - ((60 + 60 / 4) - 62.5) = 62.5 - (75 - 62.5) = 62.5 - 12.5 = 50
etc.