DeleteLayerById

Top  Previous  Next

Boolean DeleteLayerById(Int32 layerId)

 

Description:

 Delete layer by the layer's id, if  layerId not matched, it returns false. This function will delete shape(s) which belonged this layer.

 

Parameter:

 layerId: Layer id

 

Return value:

 true: Delete successfully

 false: Delete unsuccessfully

 

Example:

 private object sender, System.EventArgs e)

 {

         Int32 id;

         if (treeView1.SelectedNode.Index > -1)

         {

                 id = mainForm.myCAD1.GetLayerIdByNo(treeView1.SelectedNode.Index);

                 mainForm.myCAD1.DeleteLayerById(id);

                 

         }

         treeView1.Focus();

 }

 

See also:

 DeleteLayerByName