>>VFP6.0, VS SP1. I have a top-level form with a grid on it instantiated from a grid class I created. All works well until I place a menu in the top-level form.
>>
>>When I then try to close the form, I get the error message "COLUMNS is not an object.". The code being referenced is in the grid class's Resize event as follows:
>>
>>WITH THIS
>>.COLUMNS(1).Width = .Width - .GridBars
>>ENDWITH
>
>Do you get the same error if you explicitly state it like:
>
>this.column1.width = this.width - this.gridbars ?
>
>If you stop here in debugger, are all values defined?
Hi Bruce,
I tried the following explicit syntaxes as tests:
THIS.COLUMNS(1).WIDTH = THIS.WIDTH - THIS.GRIDBARS
resulted in same error;
THIS.COLUMN1.WIDTH = THIS.WIDTH - THIS.GRIDBARS
resulted in "Unknown member COLUMN1" error.
Yes, everything "appears" :-) defined in the debugger when the error occurs.
However, the form Resize event fires during the shutdown process. If you read Stephen's reply, I think he may be on to it. Probably has something to do with the destruction of the objects and/or the order of destruction when the form is shut down, so even tho the objects are "still defined", they must not be "seeable" when the Resize is fired during shutdown. As Stephen suggested, I guess I'll just put a flag in to test when the form is shutting down.
Thanks,
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.