|
-
Aug 19th, 2019, 06:45 PM
#2
Re: Richtextbox RTF - I learned something
This isn't really anything specific to RichTextBox's. If you create two controls on different threads then any code that access a property of both controls must be executed on a thread that does not the handle of at least one of the controls, so a cross-thread exception is inevitable. It doesn't matter whether it is the Rtf properties of RichTextBoxes, the Text properties of TextBoxes, the Value properties of DateTimePickers, the Value properties of NumericUpDowns or something else. The very same rule applies here as with any other control in any other multi-threaded application: when you access a member of a control, you must do it on the thread on which the control's handle was created. If you have two RichTextBoxes that were created on different threads then any of their properties - not just Rtf - must be access only on their respective creating threads.
Tags for this Thread
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
|