Previous Document Next Document

Understanding the CorelDRAW object model : Working with layers : Activating layers


Activating layers

Each layer is a member of the Page.Layers collection for the page on which it appears. The layers in a Page.Layers collection appear in the order in which they appear on that page — the first layer is the one at the top of the “stack,” and the last layer is the one at the bottom. If layers are added, reordered, or deleted, the affected Page.Layers collection is immediately updated to reflect the new layer order of that page.

The Document.ActiveLayer property provides direct access to the active layer for a document, while the Page.ActiveLayer property provides direct access to the active layer for a page.

You can activate a layer by using the Layer.Activate method:

ActivePage.Layers("Layer 1").Activate

 
Activating a locked layer does not unlock it. Similarly, activating a hidden layer does not make it visible. For information on unlocking and displaying layers, see Locking and hiding layers.

If you want, you can use event handlers to respond to events that are triggered by activating a layer:

 
Document.LayerActivate

You can also use event handlers to respond to events that are triggered by deactivating a layer:

 
Document.LayerChange

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.