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 / November 2007

Tip: Looking for answers? Try searching our database.

Line Breaks in Code Infopath code behind

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rjayram - 02 Nov 2007 20:01 GMT
Hi,

     Is there any way I can introduce line breaks in a multi line text box
in an Infopath 2007 form using C# code behind. For eg. I want text in this
format:
Hello
World
in my multiline text box. Any pointers would be greatly appreciated.

Thanks,
Jayram.
Bryan Phillips - 06 Nov 2007 01:46 GMT
Have you tried setting the textbox to some text that includes \r\n ?

--

Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog:  http://bphillips76.spaces.live.com
Web Site:  http://www.composablesystems.net

> Hi,
>
[quoted text clipped - 7 lines]
> Thanks,
> Jayram.
rjayram - 06 Nov 2007 05:24 GMT
Yes I did try setting the value of the text to something that included \r\n,
but without success. Do you or anyone else have any code sample that could
help?

Thanks,
Jayram.

> Have you tried setting the textbox to some text that includes \r\n ?
>
[quoted text clipped - 17 lines]
> > Thanks,
> > Jayram.
Andy Bonner - 06 Nov 2007 17:48 GMT
Using \r\n should work, can you show the code your using

> Yes I did try setting the value of the text to something that included
> \r\n,
[quoted text clipped - 27 lines]
>> > Thanks,
>> > Jayram.
rjayram - 06 Nov 2007 18:01 GMT
The following is the code I am writing to introduce a new line in a text
field. The code is in C#.

XPathNavigator _root = MainDataSource.CreateNavigator();
XPathNavigator _submitLogString =
_root.SelectSingleNode("/my:myFields/my:LogGroup/my:LogString",
this.NamespaceManager);
_submitLogString.SetValue("This is a log string. \\r\\n " + " The document
was saved " + System.DateTime.Now.ToString());

I dont know what doesnt work.

Thanks,
Jayram.

> Using \r\n should work, can you show the code your using
>
[quoted text clipped - 29 lines]
> >> > Thanks,
> >> > Jayram.
rjayram - 06 Nov 2007 18:12 GMT
Andy and Bryan,

                         Thanks for your help but I got it. I was writing
\\r\\n to account for C#'s tendency to strip one of the slashes, but it turns
out I neednt have done that. It never occurred to me to try this out before.
Stupid mistake. Thanks again for taking out the time to reply to my question.

Thanks,
Jayram.

> Using \r\n should work, can you show the code your using
>
[quoted text clipped - 29 lines]
> >> > Thanks,
> >> > Jayram.
 
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.