<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Updating content of Text Box at runtime</title><link>https://www.infopathdev.com:443/forums/thread/79751.aspx</link><pubDate>Thu, 21 Jun 2012 17:47:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:79751</guid><dc:creator>brjames</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/79751.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=79751</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Anson Hidajat:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Have you considered using the xpath function userName()?&amp;nbsp; You can set the value of the text box via rules or default value and this wouldn&amp;#39;t require writing any custom code.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;Yes I&amp;#39;ve found this out now thanks. What I also wanted to use the above code for is to populate a textbox with the users IP Address. Any ideas how I can do this?&lt;/p&gt;</description></item><item><title>Re: Updating content of Text Box at runtime</title><link>https://www.infopathdev.com:443/forums/thread/79745.aspx</link><pubDate>Thu, 21 Jun 2012 17:14:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:79745</guid><dc:creator>Anson Hidajat</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/79745.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=79745</wfw:commentRss><description>Have you considered using the xpath function userName()?&amp;nbsp; You can set the value of the text box via rules or default value and this wouldn&amp;#39;t require writing any custom code.</description></item><item><title>Updating content of Text Box at runtime</title><link>https://www.infopathdev.com:443/forums/thread/79675.aspx</link><pubDate>Wed, 20 Jun 2012 11:49:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:79675</guid><dc:creator>brjames</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/79675.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=79675</wfw:commentRss><description>&lt;p&gt;Hi all&lt;/p&gt;&lt;p&gt;I&amp;#39;m trying to do something which due to my extensive background in VB.net programing should be simple but isn&amp;#39;t!! All I&amp;#39;m trying to do is update the contents of a text box at run time with a Users&amp;#39; username. The code I&amp;#39;m using to test the text box updating is:&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Public Sub&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; FormEvents_Loading(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; LoadingEventArgs)&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;#39; Write your code here.&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; root &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = MainDataSource.CreateNavigator()&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; textbox &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; XPathNavigator = root.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:myFields/my:myIP&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager)&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;

&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;            textbox.SetValue(&amp;quot;&lt;/p&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;test&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;When I run it, nothing gets putinto the text box so it remains blank.&lt;/p&gt;&lt;p&gt;Can anyone see where I&amp;#39;m going wrong? Oh yeah - I&amp;#39;m using Infopath 2010 to create a Web Browser Form but it&amp;#39;s saved as 2007 version.&lt;/p&gt;&lt;p&gt;Thanks in advance&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>