473,320 Members | 2,000 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,320 software developers and data experts.

Keep form updated after switching windows?

Hi,

(VS2005, SP1, VB windows form)

I have a VB application that reads large files. While it is running, a
record counter is being updated and shown in a text box. If I switch to
another window, when I come back to the form, the text box is no longer
being updated. In fact the form seems frozen until the app ends. What am I
missing?

Al G
May 7 '07 #1
2 1002
Hi Al,

You need to be reading your file on a separate thread. If you aren't, then
Windows Forms never gets a chance to handle events in it's message queue,
including the form or control "OnPaint" messages; at least for the duration
of the file operation. One possible solution is to use "DoEvents ()" inside
your file reading loop if you don't want to use threads but I would strongly
recommend against that as this is not a natural pattern for this kind of
task.
Robin
May 8 '07 #2
Thanks Robin, I'll try it.

Al G
"Robin Tucker" <rt******@hotmail.co.ukwrote in message
news:f1*******************@news.demon.co.uk...
Hi Al,

You need to be reading your file on a separate thread. If you aren't,
then Windows Forms never gets a chance to handle events in it's message
queue, including the form or control "OnPaint" messages; at least for the
duration of the file operation. One possible solution is to use "DoEvents
()" inside your file reading loop if you don't want to use threads but I
would strongly recommend against that as this is not a natural pattern for
this kind of task.
Robin


May 8 '07 #3

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

Similar topics

6
by: Bob | last post by:
Declaring a module level form object in multiple froms within a project to show another project form causes a stack overflow and other assorted errors. Can anyone help?
5
by: mvr | last post by:
Hi all IIS 5.0, ASP, and https:// I have "DataEntrypage.asp" which is a data entry page(about 250 data elements includes text boxes, radio buttons, check boxes, drop down boxes etc). ...
6
by: nadeem_far | last post by:
Hello All, I am working on a .Net desktop application and I am having problem displaying a form. I am using C# and version 1.1 of the framework. here is how the code looks likes and I will...
4
by: Simon Tamman {Uchiha Jax} | last post by:
Scenario: Two System.Windows.Forms: Form1 and Form2. Form1 is displayed, Form2 is hidden. At this juncture, is it possible to take the graphics from Form2 and output that to Form1's display...
0
by: kCura | last post by:
I've got an web application that's using a hosted form in IE. The server that is hosting it is running Windows Server 2003 with SP1 and the .NET 1.1 framework. It has all of the latest and greatest...
11
by: joey.powell | last post by:
Hello, I have a windows forms application (VS2005) where I need to do the following... 1. Startup with a main form. 2. Have the user to select a file and then bring up a second form modally...
15
by: l3vi | last post by:
I have a new system Im building that stores entries of what people are searching for on my sites. I want to be able to keep records of how many times a keyword was searched for daily, and from...
11
by: cty0000 | last post by:
I have some quiestion... I want to draw line,point,rectangles and etc... on the from So I code like this.. public update() { g = this.CreateGraphics(); g.FillRectangle(Brushes.White, x1,...
1
by: =?Utf-8?B?QWxwaGFwYWdl?= | last post by:
Hello, I have built an object which does some jobs on a particular server. There can have lots of this object running concurrently. I want to know what is the best way to optimize my...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.