Hide/Partly hide User-defined Events, Methods and Properties

If an event, method or property is only meant to be used inside an ancestor form or reusable part, it can be hidden from all inheriting components using the Private property of the form or the reusable part.

Events, methods and properties defined as private are hidden from both inheriting and owner forms and reusable parts.

For example, to hide the GetInfo method, select the Private property of the ancestor form and select GetInfo from the list of possible values:

Save the form. The GetInfo method is now hidden from all other components.

Display FormB and bring up the Methods tab. GetInfo is no longer visible which indicates it is no longer available in FormB.

Note however that hidden properties, events and methods are still visible in the Component help (F2).

Partly Hide User-defined Events, Methods and Properties

If you want to hide an event, method or property from owner forms and reusable parts but still make them available to inheriting forms and reusable parts, define the event, property or method as Protected.

For example, to protect the OKPressed event, select the Protect property of the ancestor form and select OKPressed from the list of possible values:

Save the ancestor form. The OKPressed event is now hidden from owner components, but it is available to inheriting forms and reusable parts.

Display the inheriting form and bring up the Events tab. OKPressed is still visible which indicates it is available.

Then include the ancestor form (FRMDETAIL) in another form. Display the Events Tab for FRMDETAIL as a member form. The OKPressed event is not visible.

Note however that hidden properties, events and methods are still visible in the Component help (F2).

Make Partly Hidden User-defined Events, Methods and Properties Visible

In some circumstances it is necessary to make public user-defined events, methods and properties which have been hidden in the ancestor from owner components using the Protect property. This can be done using the Public property of the inheriting form or reusable part.

 

Note that the system-internal CreateInstance and DestroyInstance values are always displayed for Public. Do not use them.

Now include FormB in another form. Display the Events tab. The OKPressed event is visible and available to the owner form.