将RichTextBox Writed文本复制到vb.net中的textbox1 [英] Copy RichTextBox Writed text to textbox1 in vb.net
问题描述
大家好!
今天我有一个问题..
是否有可能从Richtextbox复制文本,如果Writed并将其克隆到其他文本框或标签?
让我给你一个想法...
我们将使用这样的代码:
Hi everyone!
Today i have a question please ..
is it possible to Copy Text from Richtextbox if Writed and Clone it to other textbox or label?
let me give you the idea...
We Will Use code like this:
Dim Words As New List(Of String)
Words.Add("name=" + Form1.textbox1.text + """") 'Notice: Don't Care about + Form1.textbox1.text + """"
所以这是一个我要复制的单词列表..
现在例如:name =test
让我们来看看那条线,所以我们知道名字=测试对吗?
现在我们想得到只有测试没有引号,然后我们将它复制到文本框或标签,对于预览或其他。
如果我们得到它并且我们在文本框中有它...
我们可以编辑它吗?喜欢:从name =Test到name =Test2
我希望你明白。
请帮忙..
So This is a List of Words i Want to Copy..
Now for example : name="test"
Lets have a look on that line ,, So We know that the name="Test" right?
Now we want to get Only the "Test" Without quotes , and then We Will Copy it to Textbox Or Label ,, For a Preview or something else.
If We Got it and We have it in a Textbox ..
Can We Edit it ? like : from name="Test" to name="Test2"
i hope u understand.
please help ..
推荐答案
请看我对这个问题的评论。
所有您需要知道的是:RichTextBox.Text
属性表示无格式文本,与RichTextBox.RTF
:
https://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.text%28v=vs.110%29.aspx [ ^ ],
https://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.rtf%28v=vs.110%29.aspx [ ^ ]。
请随意使用;带引号,没有引号,任何东西。这只不过是字符串操作。
-SA
Please see my comment to the question.
All you need to know is this:RichTextBox.Text
property represents unformatted text, in contrast toRichTextBox.RTF
:
https://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.text%28v=vs.110%29.aspx[^],
https://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.rtf%28v=vs.110%29.aspx[^].
Please do with it whatever you want; with quotes, without quotes, anything. This is nothing but string manipulations.
—SA
这篇关于将RichTextBox Writed文本复制到vb.net中的textbox1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!