Dragging from a goPalette to a specific layer

My windows application has a gopalette and a goview. I have added several layers to the goview document using GoView1.Document.CreateNewLayerAfter and want to add dragged objects to one of my new layers, I have set the DefaultLayer property for the GoView document, but this does not seem to add it to my chosen layer.

How can I do this?

The easiest way is to have the objects in the GoPalette be organized by the same layers as your GoView.Document. You can do that by creating the same layers in your GoPalette.Document, making sure they have the same Identifiers, and adding the palette items appropriately to the desired layers.

Basically, the drag-and-drop copies the selected objects by calling GoDocument.CopyFromCollection, which tries to add objects to the same layer that they came from, by comparing the GoLayer.Identifier property values.

Thanks, That works fine!