473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

GUI Delegates & Text Disappearing

Hi,

I have program, creating multiple threads, and each thread is updating
the same richtextbox(appending to previous text), and text in the
statusbar.
To update the richtextbox and statusbar, I am using delegates.

At some point in time the text in the richtextbox is being cleared off.

Also, at some point and infrequently, the following error is being
given:
"An unhandled exception of type 'System.InvalidOperationException'
occurred in mscorlib.dll
Additional information: Unable to set the panel text."
Below is the method where the error just given is being given.

string text = "MyText....."
AddTextDelegate atd = new AddTextDelegate(AddText_rtbActions);
IAsyncResult iar = atd.BeginInvoke(text, null, null);
atd.EndInvoke(iar);

UpdateCounterDelegate ucd = new
UpdateCounterDelegate(DecrementEventsExecuted);
iar = ucd.BeginInvoke(null, null);
ucd.EndInvoke(iar);
Can someone help me out
Thanks in Advance

Apr 7 '06 #1
2 1677
Do you have anymore information about the call stack? I ask because you
should have seen something more about where the exception was thrown.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Curious" <th****@mail.global.net.mt> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi,

I have program, creating multiple threads, and each thread is updating
the same richtextbox(appending to previous text), and text in the
statusbar.
To update the richtextbox and statusbar, I am using delegates.

At some point in time the text in the richtextbox is being cleared off.

Also, at some point and infrequently, the following error is being
given:
"An unhandled exception of type 'System.InvalidOperationException'
occurred in mscorlib.dll
Additional information: Unable to set the panel text."
Below is the method where the error just given is being given.

string text = "MyText....."
AddTextDelegate atd = new AddTextDelegate(AddText_rtbActions);
IAsyncResult iar = atd.BeginInvoke(text, null, null);
atd.EndInvoke(iar);

UpdateCounterDelegate ucd = new
UpdateCounterDelegate(DecrementEventsExecuted);
iar = ucd.BeginInvoke(null, null);
ucd.EndInvoke(iar);
Can someone help me out
Thanks in Advance

Apr 7 '06 #2
Hi,
I added the lock statement where I was appending text to the rtb and in
my status bar panels, and problem seems to be solved.

Apr 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Robbie De Sutter | last post by:
Hello, When I use the dotfuscator (Community Edition), all my delegate functions no longer work. I understand the reason why (the function in my delegate no longer exists under the name I try...
12
by: Joey Powell | last post by:
Re: Original post = Windows forms - how do I get them to render/update properly? from August 22. Okay I am making some progress with being able to use delegates to run my shelled processes on...
1
by: Natalia DeBow | last post by:
Hi, I am working on a Windows-based client-server application. I am involved in the development of the remote client modules. I am using asynchronous delegates to obtain information from...
7
by: web1110 | last post by:
Hi, Can someone provide me with an explanation of how delegates work. I know how to use them by rote - meaning I look at code I have employing delegates and reproduce it. My problem is that...
7
by: c#2006user | last post by:
Hi everyone. i know there is a lot of code and ive reduced it as much as i could, its a bit much to ask but i am really stuck! i've been at this for a week! this is converted from vb to c# and...
2
by: Amit Bansal \(MCT, MCSD.NET\) | last post by:
delegates are type safe. what exacly is meant by type safe ?? any good document explaining the benefits of delegates.
7
by: Siegfried Heintze | last post by:
I'm studying the book "Microsoft Visual Basic.NET Language Reference" and I would like some clarify the difference between events and delegates. On page 156 I see a WinForms example of timer that...
69
by: raylopez99 | last post by:
They usually don't teach you in most textbooks I've seen that delegates can be used to call class methods from classes that are 'unaware' of the delegate, so long as the class has the same...
9
by: raylopez99 | last post by:
Hello all— I’m trying to get the below to work and cannot get the format right. It’s from this example: http://msdn.microsoft.com/en-us/library/8627sbea(VS.71).aspx What it is: I’m trying...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.