胡思乱想的猫
象你一样自由
随笔- 31  文章- 1  评论- 101 
博客园  首页  新随笔  联系  管理  订阅 订阅
InfoPath中的Rich Text Box中如何加“回车”
       InfoPath中的Rich Text Box中实现换行的方法:

       InfoPath中的Rich Text Box的内容使用的是XHtml的格式,所以"\n"格式内容是不会表现出来的。

        如果我们需要在
Rich Text Box中添加两行内容的话,我们可以用下面的代码。

            XPathNavigator f1 = MainDataSource.CreateNavigator();

            XPathNavigator f2 = f1.SelectSingleNode("/my:myFields/my:field2", NamespaceManager);

            XmlReader xr = XmlReader.Create(new StringReader("<div xmlns=""http://www.w3.org/1999/xhtml""> abc </div>"));

            f2.AppendChild(xr);

            xr = XmlReader.Create(new StringReader("<div xmlns=""http://www.w3.org/1999/xhtml"">def</div>"));

            f2.AppendChild(xr);

            这样就可以换行了。

posted on 2007-12-26 18:03 heli猫 阅读(202) 评论(0) 编辑 收藏
刷新评论刷新页面返回顶部
程序员问答社区,解决您的IT难题
博客园首页博问新闻闪存程序员招聘知识库
Copyright ©2012 heli猫