Programming Infopath in VS.NET

A

A.M

Hi,



I am learning how to program InfoPath in VS.NET. I cannot modify a textbox's
text in C# code. I tried:



txtName.Text = "Alan";



But it doesn't compile. Perhaps InfoPath UI programming is totally different
from WinForms development. Could you give me some clue how to do that?



Thank you,

Alan
 
H

Henning Krause [MVP - Exhange]

Hello,

you don't have access to the UI at all (except for XDocument.UI.Alert and
such things). To modify content in textboxes you must modify the underlying
xml:

XDocument.DOM.SelectSingleNode("my:Fields/my:Text").text = "Lorem Ipsum";

Of course, you have to use a valid XPath expression...

Greetings,
Henning Krause [MVP - Exchange]
==========================
Visit my website: http://www.infinitec.de
Try my free Exchange Explorer: Mistaya
(http://www.infinitec.de/software/mistaya.aspx)
 

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