InfoPath controls are not the same as bound controls in Windows or ASP.NET
applications. Generally, you cannot programmatically modify properties of a
control at runtime.
In InfoPath, you must use Conditional Formatting expressions to dynamically
determine the control properties. You can control the format via rules or
program code by changing the value of an element that a Conditional
Formatting expression references.