<?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: message box with text field, is it possible?</title><link>https://www.infopathdev.com:443/forums/thread/33493.aspx</link><pubDate>Fri, 24 Oct 2008 13:27:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33493</guid><dc:creator>Bhavesh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33493.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33493</wfw:commentRss><description>&lt;p&gt;Jimmy this is really a great solution.&lt;/p&gt;
&lt;p&gt;Bhavesh&lt;/p&gt;</description></item><item><title>Re: message box with text field, is it possible?</title><link>https://www.infopathdev.com:443/forums/thread/33483.aspx</link><pubDate>Fri, 24 Oct 2008 09:33:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33483</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33483.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33483</wfw:commentRss><description>&lt;p&gt;Yeah, it&amp;#39;s great that Office files can now run practically any code that any other .NET application can run.&lt;/p&gt;
&lt;p&gt;Glad I could help!&lt;/p&gt;
&lt;p&gt;Jimmy&lt;/p&gt;</description></item><item><title>Re: message box with text field, is it possible?</title><link>https://www.infopathdev.com:443/forums/thread/33479.aspx</link><pubDate>Fri, 24 Oct 2008 08:38:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33479</guid><dc:creator>taz1919</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33479.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33479</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks to everyone for your ideas. Jimmy, that worked perfect, i didn&amp;#39;t know that windows forms could be added to the infopath project.&lt;/p&gt;&lt;p&gt;Thanks again,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Craig.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: message box with text field, is it possible?</title><link>https://www.infopathdev.com:443/forums/thread/33475.aspx</link><pubDate>Fri, 24 Oct 2008 07:44:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33475</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33475.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33475</wfw:commentRss><description>&lt;p&gt;Yes, what you describe is entirely possible if you&amp;#39;re coding in C# or VB, but it requires a moderate understanding of windows form&amp;nbsp;programming, and as the previous two posters have said, you&amp;#39;d probably be better off accomplishing this within InfoPath, without using dialogs.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Nonetheless, here&amp;#39;s a simple example in&amp;nbsp;C#&amp;nbsp;to get you started.&amp;nbsp; A real-life form would naturally be a bit more complex.:&lt;/p&gt;
&lt;p&gt;Create an InfoPath form with one text box (bound to &amp;quot;my:myFields/my:field1&amp;quot;) and a button.&lt;/p&gt;
&lt;p&gt;In Tools-&amp;gt;Form Options...-&amp;gt;Programming, choose C# as the programming language.&lt;/p&gt;
&lt;p&gt;Open VSTA. (Tools-&amp;gt;Programming-&amp;gt;Microsoft Visual Studio Tools for Applications)&lt;/p&gt;
&lt;p&gt;Select &amp;quot;Add Windows Form...&amp;quot; from the Project menu.&amp;nbsp; Select &amp;quot;Windows Form&amp;quot; from the dialog that pops up, leave the filename as Form1.cs, and click Add&lt;/p&gt;
&lt;p&gt;A new blank windows form will be created.&amp;nbsp; Now from the Toolbox (to the left), drag one TextBox and one Button onto your form.&amp;nbsp; Notice that when you click the TextBox, the Properties window shows its name as textBox1.&lt;/p&gt;
&lt;p&gt;Now double-click the button.&amp;nbsp; This will open up the code view and position your cursor inside the Button&amp;#39;s event handler.&amp;nbsp; Add the following code to that event handler:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; DialogResult = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;DialogResult&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.OK;&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp; Close();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;This tells the form to close when the button is clicked.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;One last thing you need to do is add a property to allow your InfoPath form code to access the TextBox&amp;#39;s value.&amp;nbsp; Beneath the closing brace of the Button&amp;#39;s event handler, add the following code:&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp; public&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;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; TextBoxValue&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; textBox1.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;&lt;/font&gt;So that that area of the code looks like:&lt;br /&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; private&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;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; button1_Click(&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; sender, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;EventArgs&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DialogResult = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;DialogResult&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.OK;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Close();&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public&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;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; TextBoxValue&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; textBox1.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;If you did that all correctly, that&amp;#39;s all that you need to do to the windows form.&amp;nbsp; Save the file.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Now go back to your InfoPath form.&amp;nbsp; Double-click &lt;em&gt;its&lt;/em&gt; button, and click &amp;quot;Edit form code...&amp;quot;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Add this code to the button&amp;#39;s event handler:&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&amp;nbsp;&amp;nbsp; // this line creates an instance of the dialog&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Form1&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; dialog = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Form1&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// this line opens up the dialog, and causes this code to wait until it is closed&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;dialog.ShowDialog();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// this line selects the /my:myFields/my:field1 node from your data source&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; node = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:myFields/my:field1&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;,NamespaceManager);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// this line assigns the contents of the dialog to field1&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;node.SetValue(dialog.TextBoxValue);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;Now preview the form and try it out.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: message box with text field, is it possible?</title><link>https://www.infopathdev.com:443/forums/thread/33416.aspx</link><pubDate>Thu, 23 Oct 2008 14:00:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33416</guid><dc:creator>Bhavesh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33416.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33416</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What you can do is keep a section with a set of buttons&amp;nbsp;and a readonly text box containing a message on the top of the form. Make it hidden initially and as per the requirement set it visible to the user by creating some conditional formatting. This section will display the message to the user with two buttons. You keep one more section which will be displayed on the click of NO from the previous section. Now when user click NO from first section, you conditionally make it hidden and display the second section visible containing a entry field for the user.&lt;/p&gt;
&lt;p&gt;When user entry corrected information in the second section and click OK button, you can make that section hidden and have original screen.&lt;/p&gt;
&lt;p&gt;For making the sections hidden and visible to the user you need to keep couple of field in data source which may be of boolean type and act as a flag for making sections visible and hidden to the user.&lt;/p&gt;
&lt;p&gt;Hope this will help you in solving your problem.&lt;/p&gt;
&lt;p&gt;Bhavesh&lt;/p&gt;</description></item><item><title>Re: message box with text field, is it possible?</title><link>https://www.infopathdev.com:443/forums/thread/32984.aspx</link><pubDate>Fri, 10 Oct 2008 13:27:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32984</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32984.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32984</wfw:commentRss><description>&lt;p&gt;This does not really work with popup boxes.&lt;/p&gt;
&lt;p&gt;You need to use an extra view instead.&lt;/p&gt;
&lt;p&gt;So if the conditionas are correct execute a view switch.&lt;/p&gt;
&lt;p&gt;Setup the view however you want.&lt;/p&gt;
&lt;p&gt;If yes they return tot he previous view, if no the text box appears and once data is entered a continue or what ever button appears and when clicked they proceed to the next view.&lt;/p&gt;</description></item><item><title>message box with text field, is it possible?</title><link>https://www.infopathdev.com:443/forums/thread/32954.aspx</link><pubDate>Thu, 09 Oct 2008 11:32:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32954</guid><dc:creator>taz1919</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32954.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=32954</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;&lt;p&gt;I would like to create some sort of a message box that pops up, asking the user to confirm if a some infomation is correct, if they choose &amp;#39;No&amp;#39; then i would like a new dialgue box with a text box inside asking them to enter the correct information.&lt;/p&gt;&lt;p&gt;I can do the first part which is just a basic messagebox with yesno for the buttons, its the creation of the new dialog box with text field that i cant do.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Craig.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>