Previous Document Next Document

Understanding the CorelDRAW object model : Working with layers : Locking and hiding layers


Locking and hiding layers

Layer objects feature the properties Editable and Visible, which control (respectively) whether the layer is editable and whether its contents are visible. Both properties are Boolean. By setting both the properties to True, you unlock and display the layer for editing. By setting either property to False, however, you lock the layer such that it cannot be edited.

The following sample VBA code locks, but displays, the layer on the active page:

ActivePage.Layers("Layer 1").Visible = True
ActivePage.Layers("Layer 1").Editable = False

The result of any changes to these properties is immediately displayed in the Object Manager.

The preceding example affects only the active page. You can access the layer settings for a given page by specifying a page from the Document.Pages collection, or by referencing the Document.ActivePage property. To make the changes to all pages in a document, use the Document.MasterPage property:

ActiveDocument.MasterPage.Layers("Layer 1").Visible = True

 
For more information on working with pages, see Working with pages.

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.