|
-
Dec 25th, 2009, 06:45 AM
#1
Thread Starter
Lively Member
Image and text transfering from 1 Rich Text Box to another
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?
-
Dec 25th, 2009, 06:49 AM
#2
Re: Image and text transfering from 1 Rich Text Box to another
Explore the RichTextBox properties. You'll see the rtf property. That's the one.
-
Dec 25th, 2009, 06:58 AM
#3
Thread Starter
Lively Member
Re: Image and text transfering from 1 Rich Text Box to another
if it is like this?
Code:
RichTextBox1.Rtf = RichTextBox2.Rtf
I use this but its also not working
-
Dec 25th, 2009, 07:29 AM
#4
Re: Image and text transfering from 1 Rich Text Box to another
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
-
Dec 25th, 2009, 09:55 AM
#5
Thread Starter
Lively Member
Re: Image and text transfering from 1 Rich Text Box to another
Thanks cicatrix Dear
this is the exactly thing that i need
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|