ArcPad Scripting Object Model
CanEdit Property
See Also  Example  Send comments on this topic.
Layer Object : CanEdit Property

Glossary Item Box

Description

Returns True if the layer can be made editable; False otherwise.

Property type

Read-only property

Syntax

variable = object.CanEdit

Return Type

Boolean

Remarks

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.

Example

Make Layer Editable Example
Attempt to make the layer "MyLayer" editable
Make Layer Editable Example (VBScript)Copy Code
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

See Also

© 2013 All Rights Reserved.