Hi,
You don't have access to controls by code in InfoPath is it is what you are
after. If some of your controls need to be read-only and you need to know
about it, you can do the following:
create a new node (field1) in you schema to hold a boolean and use
condtional formatting to set the read-only property of your controls based on
the value of field1 (true or false).
Then, by code you can check the value or change it for that matter...
Hope that it helps.
Franck Dauché