Hi Jana,
Do not put the rectangle height as a constant.
set it to oForm.Items.Item("rect").Height = oForm.Height - ConstantValue
You need to try on the 'ConstantValue' so that when you resize it does not overlap your text box.
For a start, open your form in design mode (either screen painter/B1 Studio).
Calculate this 'ConstantValue' as your form height - the rectangle height.
You will need to readjust this value to get the best value by trial and error.
You also need to include :
if oForm.Height<= (form height in screenpainter) then
oForm.Items.Item("rect").Height = (rectangle height in screen painter)
else
oForm.Items.Item("rect").Height = oForm.Height - ConstantValue
endif
Regards
Edy