Select to view content in your preferred language

Customising ArcPad Edit Forms

3186
1
02-13-2012 05:23 AM
DavidHume
Emerging Contributor
Hi,

We've got an ArcPad 10 Edit form that we want to customise so that if a tick box is ticked it will prevent the user from accessing one of the Pages (tabs), is that possible within ArcObjects and is there sample code to enable this to be accomplished. I'm no programmer but one of my team might be able to hash it together if given a starting point.

Thanks.

Dave.
Tags (3)
0 Kudos
1 Reply
TimHopper
Frequent Contributor
Dave,

Unfortunately, the Page Object does not have any sort of "enabled" or "visible" property.  Unless someone else chimes in, I don't know of a way to hide a page via code.  The Control Object, however, does have a property to disable or hide the control.  Perhaps you could hide or disable all of the controls on a page when the check box is checked?  You could also throw in a message box letting them know they aren't required to fill out whatever page it is you want to hide.

Also, the ArcPad object model uses vbscript or jscript, not ArcObjects.

Before you can access the controls on a page that you aren't currently on, you'll need to activate that page.  After hiding the controls you can then re-activate the page you want them to be on.

Give this a try on the OnClick event of the checkbox:

ThisEvent.Object.Parent.Parent.Pages("Page2").Activate
Application.Map.Layers("Point").Forms("EDITFORM").Pages("PAGE2").Controls("Edit1").Visible = False
Application.Map.Layers("Point").Forms("EDITFORM").Pages("PAGE1").Activate
MessageBox("Page 2 not required")

Additionally, you could use ...Controls("Edit1").Enabled = False

The "enabled" property would simply gray out the control and won't allow you to edit it.  My example removes the control completely from the page which would result in an empty page.

Maybe this is a wild workaround, but it's the best I could do off the top of my head.  I've attached an axf file with the code above, hopefully that will help.

One last thing: setting the current state of a checkbox (checked, unchecked) when a form opens is a little buggy.  Check out the following thread which might help with that.

How to UNcheck a checkbox in a form?

Perhaps this will get you started.
0 Kudos