复制RichTextBox的内容并粘贴到Hotmail,雅虎就像富文本编辑器 [英] copy RichTextBox content and paste to Hotmail, Yahoo like Rich Text Editor
问题描述
在我的vb.net应用程序,我想复制RichTextBox1的内容粘贴到
in my vb.net application i want to copy RichTextBox1 's contents and paste to
的Hotmail,雅虎样的富文本编辑器。
Hotmail, Yahoo kind of Rich Text Editor.
这是我做的到现在,但它只是复制和粘贴文本不仅没有包含图像和格式。
this is what i did until now but it only copy and paste text only not contains image and format.
RichTextBox1.LoadFile("test.rtf")
' Get the text from your rich text box
Dim textContents As String = RichTextBox1.Rtf
' Copy the text to the clipboard
Clipboard.SetText(textContents, TextDataFormat.Rtf)
RichTextBox1.Copy()
WebBrowser1.Document.GetElementById("rtetext").InnerText = Clipboard.GetText(TextDataFormat.Rtf)
第一次我认为这不是难题,但现在我觉得,这不是简单的问题。
first time i thought it not difficult problem but now i feel this is not simple problem.
我引用了很多搜索在谷歌,但只能复制和粘贴文本。
i referenced and searched much in google but only can copy and paste text .
任何帮助非常AP preciate
any help much appreciate
推荐答案
我不记得确切的细节如何做到这一点,但希望这会有所帮助。
I can't remember the exact details for how to do this, but hopefully this helps.
首先,您同时使用 RichTextBox.Copy
和 Clipboard.SetText
这似乎是多余的。
其次,使用 ClipBoard.SetText
,则表示你只复制文本,如果你想获得所有我认为你需要看的 Clipboard.SetDataObject 。
Firstly, you're using both RichTextBox.Copy
and Clipboard.SetText
which seems redundant.
Secondly, the use of ClipBoard.SetText
implies that you're only copying the text, if you want to get all the data I think you need to look at Clipboard.SetDataObject.
这篇关于复制RichTextBox的内容并粘贴到Hotmail,雅虎就像富文本编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!