Resumen Problemas al hacer unload de un formulario

Mensaje enviado por "Alberto Vernieri" <AVernieri@juncalnet.com.ar>

Hola!

A mi me daba ese error cuando intentaba hacerlo teniendo una combo desplegada...
Lo tuve que resolver poniendo una marca, un timer y en evento timer si la marca estaba puesta lo bajaba bien...

Aqui te mando la referencia del error...

Visual Basic Reference

Unable to unload within this context (Error 365)


In some situations you are not allowed to unload a form or a control on a form. This error has the following causes and solutions:

There is an Unload statement in the Paint event for the form or for a control on the form that has the Paint event.
Remove the Unload statement from the Paint event.

There is an Unload statement in the Change, Click, or DropDown events of a ComboBox.
Remove the Unload statement from the event.

There is an Unload statement in the Scroll event of an HScrollBar or VScrollBar control.
Remove the Unload statement from the event.

There is an Unload statement in the Resize event of a Data, Form, MDIForm, or PictureBox control.
Remove the Unload statement from the event.

There is an Unload statement in the Resize event of an MDIForm that is trying to unload an MDI child form.
Remove the Unload statement from the event.

There is an Unload statement in the RePosition or Validate event of a Data control.
Remove the Unload statement from the event.

There is an Unload statement in the ObjectMove event of an OLE Container control.
Remove the Unload statement from the event.


--------------------------------------------------------------------------------
Send feedback to MSDN.Look here for MSDN Online resources.
Espero que te sirva
Saludos
Alberto


>>> Pablo del Cid <pcid@tecnetron.com.gt> 08/06/01 14:47 >>>
Jovenes :

 En un formulario, tengo definido un label "lbl" con indice 0
 Luego, cuando ejecuto el programa, en cierto momento el formulario
 hace esto:
   load lbl(1)
   lbl(1).left = lbl(0).left
   lbl(1).top = lbl(0).top + lbl(0).height + 40
   lbl(1).visible = true

   load lbl(2)
   lbl(2).left = lbl(1).left
   lbl(2).top = lbl(1).top + lbl(1).height + 40
   lbl(2).visible = true
 En su orden :
   (1) Leo el objeto lbl(1) a memoria
   (2 y 3) Asigno las propiedades de posición
del objeto
   (4) Lo hago visible
   (y se repite lo mismo para leer el objeto lbl(2))

En otro punto del programa necesito bajar de memoria este objeto que yo subí, el lbl(1)

La instrucción "unload lbl(1)" me da el siguiente error
   Unable to unload within this context

Ya probe bajar primero a lbl(2) (con "unload lbl(2)") pensando que tenía que eliminar primero el último objeto leído pero me da el mismo error.

 La ayuda dice que no puedo bajar de memoria los objetos que haya puesto en el formulario en tiempo de diseño pero que SI puedo bajar los que voy subiendo en tiempo de corrida....



Resumen Resumen

Visual Basic Página de Visual Basic

Página principal Página principal

www.jrubi.com