469,616 Members | 1,792 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,616 developers. It's quick & easy.

Cloning a RichTextBox

I want to transfer a copy of a RichTextBox to a thread but can't seem to find
the right code. Something like the following seems logical but is not valid
code. I have tried variations and did Web searches but without success. Can
someone point me in the right direction?

Dim oRTF As RichTextBox
oRTF = Me.rtfUser.Clone
Me.BackgroundWorker1.RunWorkerAsync(oRTF)

Jun 9 '06 #1
2 1947
On Thu, 8 Jun 2006 17:45:02 -0700, genojoe wrote:
I want to transfer a copy of a RichTextBox to a thread but can't seem to find
the right code. Something like the following seems logical but is not valid
code. I have tried variations and did Web searches but without success. Can
someone point me in the right direction?

Dim oRTF As RichTextBox
oRTF = Me.rtfUser.Clone
Me.BackgroundWorker1.RunWorkerAsync(oRTF)


For a start, the richtextbox doesn't implement IClonable and doesn't have a
Clone method. But, anyway, what do you want to do with your richtext box in
this thread? You must not call any control's methods or access any
control's property from a worker thread so i have trouble understanding
what you could do with your cloned richtext box even if cloning a
richtextbox was possible.
Jun 9 '06 #2
Thank you. I thought that was the answer. I am just not smart enough to
check on that IClonable stuff.

I actually want to use the Me.UserRTF.rtf property but when I pass it as a
string to the thread, it sometimes does not work. Whereas the same code in
the main thread always works.

If I can't find a solution, I will post a better stated description of my
problem.

Again, thanks for the quick answer.

Jun 9 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by nouno | last post: by
8 posts views Thread by Tom | last post: by
3 posts views Thread by AVL | last post: by
9 posts views Thread by James Wong | last post: by
1 post views Thread by Dan Dorey | last post: by
reply views Thread by Chris | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.