This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Delete layer select in VB.NET windows application

Hi
How can I delete the selected layer only with a Button1_click or Key Del?

Thank you
for replay
Hi,

You can delete selected layer using Remove() method with Button1_click:
MultiLayerViewer1.Layers.Remove(layer)


See also MutiLayer Image Editor sample.
ok

but as I declare the selected layer?

dim layer....................................?

Thank you Tamila
and sorry for my more questions 🙂
It is a very easy. For example:
Dim layer As Aurigma.GraphicsMill.WinControls.Layer = MultiLayerViewer1.CurrentLayer
MultiLayerViewer1.Layers.Remove(layer)

ok work but remove all 😞 no single object select

why?

I have see example multi layer image editor in vb.net
and i view

RemoveSelectedObjects()

but is refer to _ObjectListBox

But if i not have a listbox ?

thank for reply
Maurizio
Hi,

Even through you do not use ListBox object, you should use some array where you safe the indexes of each added VObjects. For more understanding of internal logic of Vector Objects I recommend you to read the following article:
Using Vector Objects

It helps you to understand how to work with Vector Objects.

it's ok for Remove layer
Dim layer As Aurigma.GraphicsMill.WinControls.Layer = MultiLayerViewer1.CurrentLayer
MultiLayerViewer1.Layers.Remove(layer)

but for remove VObject in Layer?

😞

Thank you Maurizio
Hi,

If you want to remove VObjects from layer you should use this code:
For Each i As Aurigma.GraphicsMill.WinControls.IVObject In MultiLayerViewer1.CurrentDesigner.VObjects
	MultiLayerViewer1.CurrentLayer.VObjects.Remove(i)
Next