Setting propperties on a FormControl without AutoDeclaration

  • March 19, 2010

When you want to set a property of a control on a form without setting the property AutoDeclaration = yes. You can address the control trough the following code, knowing that element is a FormRun-object:"btnOk").visible(false);
  1. Björn left a comment on March 19, 2010 at 10:04 am

    Handy trick indeed.

    If you want a compile time check on the control name you can write it like this:;

    Control is a special enum that maps a name to a control ID. It great for catching typos.

  2. Klaas Deforche left a comment on March 19, 2010 at 10:45 am


    An other way is:


    It is better (imo) because you will get a compilation error if the control does not exist. In your example, the compiler will not warn you if btnOk does not exist as a control.


Comments are closed.