ArcPad Scripting Object Model
Parent Property
See Also  Send comments on this topic.
Control Object : Parent Property

Glossary Item Box

Description

Returns a reference to the page that contains the control.

Property type

Read-only property

Syntax

Set variable = object.Parent

Return Type

Page Object

Remarks

Use the Parent property to get access to other controls on the same page without having to use their fully qualified paths. For example, a form named "frmMyForm" has a page named "pgPage1". This page contains two controls: "txtControl1" and "txtControl2". The code below uses the fully qualified path to access each control:


  Dim objCtrl1, objCtrl2
  Set objCtrl1 = Forms("frmMyForm").Pages("pgPage1").Controls("txtControl1")
  Set objCtrl2 = Forms("frmMyForm").Pages("pgPage1").Controls("txtControl2")
  
By using Parent, the code can be shortened to:


  Dim objCtrl1, objCtrl2
  Set objCtrl1 = Forms("frmMyForm").Pages("pgPage1").Controls("txtControl1")
  Set objCtrl2 = objCtrl1.Parent.Controls("txtControl2")
  

See Also

© 2012 All Rights Reserved.