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

Form refresh/redraw issue

Hi,

I'm new to C# so please be patient with me.

Ok, I have a small app that analyses the content of about 10,000 log files.
The application works fine and outputs the expected results. But I need a
form that displays the status of the job it is running so the guy's using it
now it is working etc.

So, the problem is that if I don't touch the PC while it is running this app
the progress bar a label are updated fine. But if the form looses focus or I
click on the form it stops updating. The app continues and finishes without
problems although the status form becomes useless.

Hope that makes sense.

Ollie (C# Rookie)
Nov 16 '05 #1
2 13124
Hi Ollie,

One solution for you would be create a working thread that send an event to
the interface each time a new file start to process you need to use
Control.Invoke to send the event to the main thread. I have some code aroud
that do this, just let me know if you need it.
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Ollie" <ol**********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I'm new to C# so please be patient with me.

Ok, I have a small app that analyses the content of about 10,000 log files. The application works fine and outputs the expected results. But I need a
form that displays the status of the job it is running so the guy's using it now it is working etc.

So, the problem is that if I don't touch the PC while it is running this app the progress bar a label are updated fine. But if the form looses focus or I click on the form it stops updating. The app continues and finishes without problems although the status form becomes useless.

Hope that makes sense.

Ollie (C# Rookie)

Nov 16 '05 #2
Ignacio,

That would be great. I was thinking that having separate threads was the
best way to go.

Thanks for you response and the sample code would be very helpful.

Ollie

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi Ollie,

One solution for you would be create a working thread that send an event to
the interface each time a new file start to process you need to use
Control.Invoke to send the event to the main thread. I have some code aroud
that do this, just let me know if you need it.
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Ollie" <ol**********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I'm new to C# so please be patient with me.

Ok, I have a small app that analyses the content of about 10,000 log files. The application works fine and outputs the expected results. But I need a
form that displays the status of the job it is running so the guy's using it now it is working etc.

So, the problem is that if I don't touch the PC while it is running this app the progress bar a label are updated fine. But if the form looses focus or I click on the form it stops updating. The app continues and finishes without problems although the status form becomes useless.

Hope that makes sense.

Ollie (C# Rookie)


Nov 16 '05 #3

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

Similar topics

2
by: marco | last post by:
Juste a simple question about the DC in wxpython ... I've made a wxWindow class, where i need to paint myself the content. so i've added an evt_paint() to draw in the wxPaintDC ... It works like...
5
by: laredotornado | last post by:
Hello, When the user resizes the browser (either by clicking on the lower right or clicking the button at the upper left to maximize screen dimensions or not), how do I catch that event and then...
1
by: kiplring | last post by:
I wrote a program which draw a dancer at cornor of desktop. ( I Accessed through hDC) But It has a problem. I remains all trait at the desktop until I invoke any Redraw( Refresh) action - click,...
2
by: Joe Bloggs | last post by:
I have a Windows form application that has a start button, a progress bar and also writes information to the status bar the code is C#. My problem is that when you hit the start button and the...
1
by: oscar | last post by:
my program draws a form and when you click the start button another form is drawn with a progress bar as it runs through a function. my issue is that when you click on another progrem then try to...
17
by: SamSpade | last post by:
picDocument is a picturebox When I do picDocument.Invalidate() the box paints. But if instead I do picDocument.Refresh() the box does not paint. What does Refresh do. I guessed it did an...
8
by: George | last post by:
Hello everyone, I am using C# on a Pocket PC 2003 project based on .Net Compact Framework of Visual Studio 2005. I want to re-draw some controls of a Form (Window) at a regular interval (for...
10
by: John Brown | last post by:
Hi there, Does anyone know how to (generically) determine the currently active form for an application using a "static" function (so I can call it from anywhere). There is no offiical way I've...
3
by: R.A.F. | last post by:
Hi, I have a custom control in which i have a property based on CollectionBase class. like the following one : //------- XGrid.cs file --------------// public ColumnsCollection Columns {
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
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.