如何在后台生成一个System.Windows.Forms.RichTextBox,并且显示在一个Border里? 下面代码不行: System.Windows.Forms.RichTextBox rtb=new System.Windows.Forms.RichTextBox(); this.border.Child=rtb; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是在WPF下调用WinForms的RichTextBox的例子。原来,挺简单的,不过估计很多人不知道:首先,添加引用:右击References-->.NET-->System.Windows.Forms;接着,添加引用:右击References-->Browse-->C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\Framework\v3.0\WindowsFormsIntegration.dll然后,在后代代码中写上:System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();System.Windows.Forms.RichTextBox rtb = new System.Windows.Forms.RichTextBox();host.Child = rtb;this.border.Child = host; this.name = name;啥意思啊,吓死人了 一个简单的问题 招工帖,有兴趣的和我联系 C#读取EXCEL表格使用COM和ADO.NET哪个更好一点 如何使用TTS循环播放语音的问题.请帮帮我,不胜感激. 远程对象问题,2003下没问题,移植到2005后提示身份验证问题,高手帮忙 100分求教,为什么导出成dbf文件时不能生成新文件? REMOTING结构,如何实现对系统的运行情况进行监控? 動態改變Webservice的數據連接串問題 Deserialize问题,大家帮忙看看 Gridview 新手问题 急啊 有空就来看下 谢谢各位 VS2010怎样设置开启全部警告?
首先,添加引用:右击References-->.NET-->System.Windows.Forms;接着,添加引用:右击References-->Browse-->C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\Framework\v3.0\WindowsFormsIntegration.dll然后,在后代代码中写上:
System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
System.Windows.Forms.RichTextBox rtb = new System.Windows.Forms.RichTextBox();
host.Child = rtb;
this.border.Child = host;