Returns True if the layer can be made editable; False otherwise.
Read-only property
variable = object.CanEdit |
Boolean
CanEdit does not check if the layer is currently editable; it only checks to see if the layer can be made editable. Use the Editable property to actually make the layer editable.
CanEdit value is set based on the <LAYER readonly=""false""> which must be under the <ArcPad> tag. iF the <readonly> attribute is set to true or there is no <readonly> tag, the CanEdit value is set to true. Then the Edit checkbox on the Layers page (inside Table of Content dialog window) is visible.
The Layer.Editable property can be set only when CanEdit value is true.
CanEdit value is set based on the <LAYER readonly=""false""> which must be under the <ArcPad> tag. iF the <readonly> attribute is set to true or there is no <readonly> tag, the CanEdit value is set to true. Then the Edit checkbox on the Layers page (inside Table of Content dialog window) is visible.
The Layer.Editable property can be set only when CanEdit value is true.
Make Layer Editable Example
Attempt to make the layer "MyLayer" editable
Make Layer Editable Example (VBScript) | ![]() |
---|---|
Sub MakeEditable 'Check if the layer can be made editable If Not Application.Map.Layers("MyLayer").CanEdit Then MsgBox "MyLayer cannot be edited.",vbExclamation,"Error" Exit Sub End If 'If the layer is not already editable, make it editable If Not Application.Map.Layers("MyLayer").Editable Then Application.Map.Layers("MyLayer").Editable = True End If End Sub |