NOCLOSE Property

 

Enable or disable the capability to close the Window

 

 

Description:

 

The NOCLOSE Property can be used to turn a Window's close button and system menu CLOSE option on or off

 

The image below demonstrates a Window with the NOCLOSE property set to true(.T.). Note that close button next to the Minimize and Maximize buttons is greyed out. The CLOSE (ALT-F4) option on the system menu is also disabled

 

NoClose Property

 

Syntax:

 

    THISWINDOW | <FormName>.NOCLOSE --> lValue

 

    THISWINDOW | <FormName>.NOCLOSE := lValue

 

Valid For Use With:

 

This Property is assumed to be available for use with all Window types

 

Notes:

  1. This property is only available after Window definition

  2. It is one of the newer properties which is intended to overcome a limitation when defining a Window where it is not possible to set a Window's close button and system menu CLOSE option on or off

  3. Important: The values used or returned by THISWINDOW | <FormName>.NOCLOSE can easily be misunderstood!

    • Firstly, when you change the value the old value is not returned

    • Secondly, when you need to change the value (either turn the Window's close button and system menu CLOSE option on or off you do use the value that you would expect. Eg. to turn the Window's close button and system menu CLOSE option off, you would use THISWINDOW | <FormName>.NOCLOSE := .T.

    • Finally, note that the value returned when using THISWINDOW | <FormName>.NOCLOSE is the value that you would expect (which is not the case for other properties such as THISWINDOW | <FormName>.NOCAPTION)! So if you run THISWINDOW | <FormName>.NOCLOSE := .T. and then run THISWINDOW | <FormName>.NOCLOSE the value returned is .T.!

  4. No help documentation was published with the original or subsequent releases of HMG

Properties:

 

The following Property is available after the Window has been defined

 

lValue Logical R, W Gets / Sets a logical value to enable the Window's Close button and System Menu Close option. Please refer to Note 3, above

 

D - Properties of this type can be used when defining a Window

R - Properties of this type can only be accessed (read) after the Window has been defined

W - Properties of this type can be changed (write) after the Window has been defined

 

See GETPROPERTY and SETPROPERTY functions for further infomation on accessing or changing properties or use semi-OOP syntax

 

Sample Code:

 

Sample code to test this Property can be found here