Ver Mensaje Individual
  #4  
Antiguo 03-07-2005
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.141
Reputación: 36
dec Tiene un aura espectaculardec Tiene un aura espectacular
Hola,

A ver si me aclaro, que tal vez halla hablado demás:

Cita:
Empezado por ayuda de Delphi
caNone The form is not allowed to close, so nothing happens.
caHide The form is not closed, but just hidden. Your application can still access a hidden form.
caFree The form is closed and all allocated memory for the form is freed.
caMinimize The form is minimized, rather than closed. This is the default action for MDI child forms.
¿Cómo es posible que no me funciona "caHide"? ¿Será que no vale para el formulario principal del programa? Me va bien "caNone"... en el formulario principal, pero, por ejemplo "caMinimize" no hace lo que se espera de ella.

Lo que sigue de la ayuda de Delphi tampoco es que me aclare mucho:

Cita:
Empezado por ayuda de Delphi
If a form is an MDI child form, and its BorderIcons property is biMinimize, then the default Action is caMinimize. If a MDI child form does not have these settings, the default Action is caNone, meaning that nothing happens when the user attempts to close the form.

If a form is an SDI child form, Action defaults to caHide.

To close the form and free it in an OnClose event, set Action to caFree.
Sin embargo, parece ser el evento "OnClose" el que tal vez convenga usar en este caso, y vuelvo a la ayuda de Delphi:

Cita:
Empezado por ayuda de Delphi
Use OnCloseQuery to specify the conditions under which the form can close. An OnCloseQuery event handler returns a Boolean CanClose value that determines whether a form is allowed to close. Its default value is true.

You can use an OnCloseQuery event handler to ask users if they are sure they really want the form closed immediately. For example, you can use the handler to display a message box that prompts the user to save a file before closing the form.

The TCloseQueryEvent type points to the method that determines whether a form can be closed. The value of the CanClose parameter determines
if the form can close or not.
O sea, algo se me está escapando y no es que "no me funcione" la variable "caHide" del evento "OnClose", pues no faltaba más...
__________________
David Esperalta
www.decsoftutils.com
Responder Con Cita