Toolstrip and threading


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I tried to create a user control that included a TxText control and a toolstring (within a toolstrip container). It works great (I used the SF richtextbox/richtextboxtoolstrip as a starting place) except when I use it on a form that I load via another thread (I instantiate the form on another thread, save it away in a static field). The form is a wizard form (SF wizard) and one of the pages has this TxTextControl user control on it. When that page is navigated to, I get a threading error saying that I can't access the toolstrip from another thread that it was created on. None of the other controls are having problems, just the .NET toolstrip. Does anyone know what the problem is?
Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You can, but the object has probably been disposed or is trying to be disposed and one thread is not allowed to touch the other.  If you manually set your cache property to Nothing before it is disposd then your error may go away.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search