473,473 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Very Fast Updates to GUI - blank out

I have an application that does alot of work and calculations. It
updates it's internal status on a windows form. When I debug single
step the numbers appear just right on the form. When I run the program
in normal mode the text boxes to which the info is displayed just blank
out. Sometimes the entire form just turns all white. I get the
impression that the updates are happening too fast or something like
that.

What's going on? Any ideas?

Jan 17 '06 #1
5 3292

"carqs123" <ca******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I have an application that does alot of work and calculations. It
updates it's internal status on a windows form. When I debug single
step the numbers appear just right on the form. When I run the program
in normal mode the text boxes to which the info is displayed just blank
out. Sometimes the entire form just turns all white. I get the
impression that the updates are happening too fast or something like
that.

What's going on? Any ideas?


The update processing is taking time so the paint event is not able to paint
the form until it's finished perhaps.
Does the form eventually get painted with the correct data if you leave it
long enough?

Chris
Jan 17 '06 #2
carqs123 <ca******@hotmail.com> wrote:
I have an application that does alot of work and calculations. It
updates it's internal status on a windows form. When I debug single
step the numbers appear just right on the form. When I run the program
in normal mode the text boxes to which the info is displayed just blank
out. Sometimes the entire form just turns all white. I get the
impression that the updates are happening too fast or something like
that.

What's going on? Any ideas?


What is your threading model? Are you doing most of your work in the UI
thread? If so, that's the problem. See
http://www.pobox.com/~skeet/csharp/t...winforms.shtml

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jan 17 '06 #3
Me
Yea. it sounds like you are telling it to paint itself to death!
Paint()
Paint()
........
Paint()

There is no time given to actually update the display (screen) because it is
stuck inside a very tight loop. Sort of like

while(true)
{
Paint();
}

Might want to look over your program flow and see if you can break it up
some. Maybe use a timer or something like that to update the display? Do you
really need to see an update on the screen every 10ms? Would every 100ms
work just as good?

"carqs123" <ca******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I have an application that does alot of work and calculations. It
updates it's internal status on a windows form. When I debug single
step the numbers appear just right on the form. When I run the program
in normal mode the text boxes to which the info is displayed just blank
out. Sometimes the entire form just turns all white. I get the
impression that the updates are happening too fast or something like
that.

What's going on? Any ideas?

Jan 17 '06 #4
Update to this thread. I finally found the solution by reading the
O'Reilly book on Windows Forms.

I was missing an Application.DoEvents() statement.

Jan 25 '06 #5
carqs123 <ca******@hotmail.com> wrote:
Update to this thread. I finally found the solution by reading the
O'Reilly book on Windows Forms.

I was missing an Application.DoEvents() statement.


Calls to do events should very, very rarely be useful if you're already
threading properly - e.g. not doing your main work in the UI thread.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jan 25 '06 #6

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

Similar topics

4
by: Tan Thuan Seah | last post by:
Hi all, I am currently coding a sparse factorization program for my project. I intend to make a comparison of the column based method and multifrontal method in terms of running time, but I am...
2
by: Molly | last post by:
Does anyone know of any good tools for fast, on-line reorgs of a very large DB2 UDB table? We need to reorg a couple of our large (+1 billion rows) tables. We migrated from V7.2 to V8.1, but we...
6
by: Sparticus | last post by:
I have a database that isn't very big. It has about 2400 rows in it. I try and do an update like this one below (it looks big, but it's really not if you look at it) : UPDATE jobs SET...
10
by: Jason Curl | last post by:
Greetings, I have an array of 32 values. This makes it extremely fast to access elements in this array based on an index provided by a separate enum. This array is defined of type "unsigned long...
9
by: Durgesh Sharma | last post by:
Hi All, Pleas help me .I am a starter as far as C Language is concerned . How can i Right Trim all the white spaces of a very long (2000 chars) Charecter string ( from the Right Side ) ? or how...
50
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
4
by: T.H.N. | last post by:
I'm trying to work out a database design to make it quicker for my client program to read and display updates to the data set. Currently it reads in the entire data set again after each change,...
4
by: veaux | last post by:
Help! I understand how primary keys work, but may need some creative thinking to help with this. Can't be first time it was asked. I have a streets table with a primary key of street ID. Table...
0
by: kalyanakrishna | last post by:
I have a datalist and in that im displaying the images(26) which are created using GUI and im using the "img.save(Response.OutputStream, ImageFormat.Jpeg)" command. Very first time the images are...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.