Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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:
VB
Dim Words As New List(Of String)
Words.Add("name=" + Form1.textbox1.text + """") 'Notice: Don't Care about + Form1.textbox1.text + """"

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 ..
Posted
Comments
Sergey Alexandrovich Kryukov 24-Feb-15 17:18pm    
Why doing that? Just to loose formatting? Why using Rich text then? What's the problem?
Also, when you talk about RichTextBox, the question is: which one? Full type name, please. (From context, it should be System.Windows.Forms.RichTextBox, but it is not always obvious. Please avoid such confusion.)
—SA

1 solution

Please see my comment to the question.

All you need to know is this: RichTextBox.Text property represents unformatted text, in contrast to 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[^].

Please do with it whatever you want; with quotes, without quotes, anything. This is nothing but string manipulations.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900