TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rene Nielsen
NA
22
31.5k
Seperate thread invoke problem
Mar 15 2011 5:31 PM
Hey i have created a Usercontrol for a scrolling text field.
the problem is when u insert this control on a form and the user chooses to close the form it starts disposing the objects
if my 2nd thread running the text on the usercontrol then is in the middle of invoking the textBox object i get an error.
this is due to the fact that it has been disposed.
The problem is i cant stop it from getting that error because it sometimes gets stuck at the position i posted below.
The 2nd thread has already passed the arguments supposted to stop it from doing it if the object is disposed or dosent need to be invoked
and it throws an error
if(Running)
{
if(this.InvokeRequired)
{
HERE -> this.Invoke(new InvokeDelegate(delegate
{
textBox1.Text = theNewText;
}));
}
}
Attachment:
floatingtext.zip
Reply
Answers (
1
)
Precision Delay
Console Game App - Tic Tac Toe