Hi
I want to transfer data from one rich text box to another
but when i use
RichTextbox2.text = RichTextbox1.text
it transfer just text not images
if there is any way to do so?
Printable View
Hi
I want to transfer data from one rich text box to another
but when i use
RichTextbox2.text = RichTextbox1.text
it transfer just text not images
if there is any way to do so?
Explore the RichTextBox properties. You'll see the rtf property. That's the one.
if it is like this?
I use this but its also not workingCode:RichTextBox1.Rtf = RichTextBox2.Rtf
It must work. Strange
Check this out:
http://www.codeproject.com/KB/edit/csexrichtextbox.aspx
This is another quote:
In RTF, a picture is defined like this:
'{' \pict (brdr? & shading? & picttype & pictsize & metafileinfo?) data '}' A question mark indicates the control word is optional. "data" is simply the content of the file in hex format. If you want to use binary, use the \bin control word.
For instance:
{\pict\pngblip\picw10449\pich3280\picwgoal5924\pichgoal1860 hex data}
{\pict\pngblip\picw10449\pich3280\picwgoal5924\pichgoal1860\bin binary data}
\pict = starts a picture group, \pngblip = png picture \picwX = width of the picture (X is the pixel value) \pichX = height of the picture \picwgoalX = desired width of the picture in twips
So, to insert a picture, you just need to open your picture, convert the data to hex, load these data into a string and add the RTF codes around it to define a RTF picture. Now, you have a self contained string with picture data which you can insert in the RTF code of a document. Don't forget the closing "}"
Next, you get the RTF code from your RichTextBox (rtbBox.Rtf), insert the picture at the proper location, and set the code of rtbBox.Rtf
Thanks cicatrix Dear
this is the exactly thing that i need http://www.kolobok.us/smiles/other/heart.gif