385 An error occurred when setting the property named 'Size' of the object named '< >' of type 'TableFrame'.

Problem: Getting error "An error occurred when setting the property named 'Size' of the object named '< >' of type 'TableFrame'." followed by "Cannot delete object(s) that are in use"

when changing size of a tableframe and focus is in any row but the first.
Date: 27 February 2003
Versions: Tested in P10 and later.

Description by: Ivica Kolar
We can not resize a TableFrame if any of the rows other than the first one have to retrieve the focus.

Create a form with an undefined tableFrame object, named aTF.
Add a pushButton object. Button should have TabStop=TRUE
Add this code to the pushButton event.
var
    mp point
endvar
mp = aTF.Size	
mp.setX( mp.x() -1000)
aTF.Size = mp

Test 2.1, Steps:
1. Run the form. Note: Focus is at the first row, first field.
2. Push the button

Result:
Focus moves to the button.
Size of the tableframe decreases.

3. Using mouse, move the focus to row other then the first, say the second row, first field.
3.1 Push the button

Result: As above.

4. Open the form, uncheck button's TabStop property, Save/Close/Run the form.
5. Push the button.
Result:
Focus stays at the first row, first field.
Size of the tableframe decreases.
6. Repeat steps 3., 3.1.

Result:
An error occurred when setting the property named 'Size' of the object named '< aTF >' of type 'TableFrame'.
Cannot delete object(s) that are in use.

Solution:
Move focus out of the tableframe during this operation.

To index