Modifying Control elements by using VB .NET

J

Janko

Hi guys,
one short question I have.

I would like to change control elements in Infopath 2007 by using VB .Net
code.

For example:
- I have a DropDown List and now I would like to disable the DropDown Field
by Code or
- How Can I set the visibility true or false for sections, textboxes, etc.

Has anyone a url with information for me or a Code example how to write code
that it is working.

any help is more then welcome

cheers
Janko
 
S

S.Y.M. Wong-A-Ton

You must use conditional formatting on the controls if you want to show/hide
or enable/disable them. The way you would do this is add a helperField to
your data source and then use this field in the conditional formatting rules
you set up for controls. Then in code you can programmatically set the value
of the helperField to kick off the conditional formatting.

Properties of controls cannot be accessed from code, except for their value.
 
J

Janko

Hi,
Thank you very much for your hint :) It helped me alot. Now I can solve my
probs.

But I do find it really strainge that it is not allowed to change the
control properties by code.
I do not understand why this is not possible.
Normally anything can be changed by code, am I right ?

Anyway Thank you very much

cheers Janko
 
S

S.Y.M. Wong-A-Ton

Normally anything can be changed by code, am I right ?

Welcome to the wonderful world of InfoPath. :) This is the very reason why
InfoPath is considered to be such an easy tool, yet so difficult for
programmers to understand and pick up.

InfoPath controls are not your normal controls as in other programming
environments, since InfoPath is all XML. So no, not everything can be changed
by using code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top