Example: Enabling and Disabling Controls

<< Click to Display Table of Contents >>

Navigation:  Interactive Documents > Accessing Controls >

Example: Enabling and Disabling Controls

Previous pageReturn to chapter overviewNext page

At runtime you can enable and disable Controls. A disabled Control can not receive the focus and therefore the user can't change its content.

 

Example on how to disable a control, which is already dumped into a VPE Document:

tpl.FindControl("rbMeat").ControlEnabled = False

 

Example on how to enable a control, which is already dumped into a VPE Document:

tpl.FindControl("rbMeat").ControlEnabled = True

 

Do not mismatch Field-Objects and Control-Objects:
Field-Objects are used to exchange data between your application and Controls.
Control-Objects are used to identify Controls, in order to handle their events, to access and modify their properties and to steer the focus handling.