Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>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
>
>Gridbars is a property of the grid class. This code executes without error on form close until the menu is placed in the form. Then the error occurs.
>
>The menu is placed in the form in the form Init as follows:
>
>DO MAINMENU.MPR WITH THIS, .T.
>
>It is subsequently removed in the Destroy of the form as follows:
>
>RELEASE MENU (THIS.Name) EXTENDED
>
>Thanks,
>Bill
I'm going to take a wild stab in the dark here as I typically work with top-level forms and put a menu on them. I do believe that when this is done, or if you add a toolbar, the top-level form resizes to fit the desktop and still accomodate the menu or toolbar. This is what is firing the .Resize event. The form is probably trying to resize again when you release the menu. I use the top-level form as a desktop only letting it support the menu and toolbar. I don't put controls on it except for a textbox to create a dummy wait state. You may need to put a flag on the form indicating that you are trying to close and issue NODEFAULT in the resize event.
Steve
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement