473,386 Members | 1,803 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,386 software developers and data experts.

RichTextBox hangs when being clicked on while periodically beingupdated by a background worker

Hi Group!

I have a simple GUI featuring a RichTextBox and a Button. On Button
click, I start a BackgroundWorker that performs a query on the database
firing a ProgressChangedEvent for every row. The corresponding event
handler appends the row to the RichTextBox.

This works quite fine, but if I click into the TextBox while the
BackgroundWorker is running, the TextBox gets blank and the GUI hangs
until the BackgroundWorker has finished. As soon as it has, the TextBox
is updated again correctly and everything is fine again. If I don't
click into the TextBox, it does update and display correctly.

There are no event handlers whatsoever attached to the TextBox.

Any ideas?

cheers

Mathias
Jan 22 '08 #1
1 1532
On Tue, 22 Jan 2008 04:19:18 -0800, Mathias Weyel <ne**@josquin.orgwrote:
I have a simple GUI featuring a RichTextBox and a Button. On Button
click, I start a BackgroundWorker that performs a query on the database
firing a ProgressChangedEvent for every row. The corresponding event
handler appends the row to the RichTextBox.

This works quite fine, but if I click into the TextBox while the
BackgroundWorker is running, the TextBox gets blank and the GUI hangs
until the BackgroundWorker has finished.
It sounds as though in your button click handler, you are waiting for the
BackgroundWorker to complete.

If you are, then don't do that.

If you're not, then you should post a concise-but-complete sample of code
that reliably reproduces the problem. There's no way for someone to help
you fix your implementation without knowing what the implementation is.

Pete
Jan 22 '08 #2

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

Similar topics

1
by: john woo | last post by:
Hi I'm not good at JS, but want to get more about it. I want to use a JSP (the java code just used to get date, the rest are html and javascript), to display a table. the requirement is the...
1
by: Serge | last post by:
Hi, I am having some lock up problems in my c# code. when from a 2nd thread (worker thread) i call a normal standard function like Trace.WriteLine the 2nd thread freezes/hangs. The 2nd thread...
5
by: Serge | last post by:
Hi, I am having a thread hang problem in my c# code. The example on the website: http://csharp.web1000.com/ is a simplified version of my problem. You will see in the form that a...
2
by: KenH | last post by:
I am getting an unhandled system exception while writing to a RichTextBox. The process may run for a few hours or days before the error is generated The message is "Cannot access a disposed object...
3
by: zbcong | last post by:
hello i put a richtextbox and a button on the winForm.when the button is clicked,it generate several threads to write to the richtextbox,the code snippet as following: private void...
6
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a...
3
by: David Cartwright | last post by:
Hi all, I'm having a weird time with a call to the Refresh() method of a DataGridView. I have a VB.NET 2005 Windows application with a main form and a "worker" thread. The main form delegates a...
6
by: Andreas Tawn | last post by:
I'm trying to integrate the timeout function from here http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473878 into a long running automation script and the following code causes IDLE after...
1
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I have a class that Form1 calls to do some work. I would like to report back progress from the class to a richtextbox, will call it m_report, on the form. Like in the class, Form1.m_report.Text=...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.