Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / September 2005

Tip: Looking for answers? Try searching our database.

Access Infopath UI control on the form  in .NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Xin Chen - 04 Sep 2005 08:34 GMT
I want to modify some property of the form when a event happen, for example,
disable certain textbox when user click on a radio button.  I went though a
lot of document, but they only show how to access the data(via
thisXDocument), but not hte UI object itself.  Does anyone know how to acces
the UI control on the from so that I can disable or enable then
programmatically?  Thanks

--xin chen
Franck Dauché - 05 Sep 2005 03:12 GMT
Unfortunately you can't control your UI by .Net code.  Keep in mind that your
form could be displayed in IE as html (xml + xsl).  Your code couldn't make
it there, as a result, IP doesn't support that functionality.  The only way
to achieve "advanced" behavior from your UI (not provided by IP) is to
manipulate your xsl file by hand.

Franck Dauché

> I want to modify some property of the form when a event happen, for example,
> disable certain textbox when user click on a radio button.  I went though a
[quoted text clipped - 4 lines]
>
> --xin chen
Scott L. Heim [MSFT] - 06 Sep 2005 13:47 GMT
Hi Xin Chen,

Frank is correct - InfoPath is completely data driven so you do not have
programmatic access to the controls. However, you can achieve what you want
through "Conditional Formatting."

- Right-click on your text box and choose Properties
- Select the Display tab
- Click the Conditional Formatting button
- Click Add
- From the first box, select your option button field
- From the second box, select "is equal to"
- From the third box, choose Type a number and enter the value to test
against (i.e. if you have 2 option buttons typically these have values of 1
and 2)
- Select the formatting you desire (i.e. hiding the control, making it
read-only, etc.)

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.