Update/Refresh Problem

  • Thread starter Thread starter Bernie Hunt
  • Start date Start date
B

Bernie Hunt

I have a simple app that grabs records from a database and steps through
them processing each record. I have three text fields on the form to give
the user feedback on the progress.

With each new record I update the three fields on the form with the
information from the current record. I initially wasn't getting the fields
updated, so I added a .refresh() for each field as new data was added.

The problem is when the form loses focus, it stops updating. If I minimize
the form while it's processing records and then restore it, the user
interface is not updated any more. It stays at the last state before it was
minimized.

Any suggestions on how to keep the user interface updating when it's
restored of if its covered by another window and then re-exposed?

Thanks,
Bernie
 
Bernie,

Do you have any idea how we can try to help you if we don't even know what
from what your UI exist.

To give you an example what can help in that.

Is it a webpage, an PDA, a windowsform. etc.
Where have you stored the grabbed records etc.
Is your UI a textbox a couple of textboxes, a datagrid etc.
Are you using version 2002, 2003, 2005

We are not interested to know that you are using Windows XP, an Intel
processor, etc.

Cor
 
Bernie Hunt said:
I have a simple app that grabs records from a database and steps
through them processing each record. I have three text fields on the
form to give the user feedback on the progress.

With each new record I update the three fields on the form with the
information from the current record. I initially wasn't getting the
fields updated, so I added a .refresh() for each field as new data
was added.

The problem is when the form loses focus, it stops updating. If I
minimize the form while it's processing records and then restore it,
the user interface is not updated any more. It stays at the last
state before it was minimized.

Any suggestions on how to keep the user interface updating when it's
restored of if its covered by another window and then re-exposed?


You ran across an ugly behavior in WindowsXP: Even calling refresh is
ignored. Reason: Read 3rd paragraph at
http://msdn.microsoft.com/library/e...ssagequeues/aboutmessagesandmessagequeues.asp

see also:
http://groups.google.com/group/micr..._frm/thread/1682ea1a86cec239/301d3b0355269ec2



ARmin
 
The form is a windows form, it has three text boxes for outputing fields
from the records, two combo boxes for setting up parameters for the sql
query and a button to start the query.

The records are selected with a datareader and after they have been read
are discarded. Each record is read into a group of variables that will be
used to create records in a table in a typed dataaset, but right now the
variables get created and then destroyed for the next record. This is a
test of concept app for me in learning VB.net.

I'm using VS 2003.

Bernie
 
Bernie,

I have sent you a sample in another newsgroup, have a look at this first, I
thought that some of your questions are in that.

Cor
 
Armin,

Your the wizard!

I used your recommondation to call PeekMessage and I also added a
Me.Refresh to keep the form refreshed on redisplay. Now my only problem
is the form does not return to focus if I click the blue bar at the top.
The minimize and maximize button do not work either. Does it sound like I
missed something?

I think I may also need to play around with how often I refresh and
PeekMessage. With 11K records to process I don't want to waste overhead
on refreshing too much, especially if the user can't see the change
anyway.

Interesting reading on the MSDN article.

Bernie
Who has a lot to learn!
 
Bernie Hunt said:
Armin,

Your the wizard!

I used your recommondation to call PeekMessage and I also added a
Me.Refresh to keep the form refreshed on redisplay. Now my only
problem is the form does not return to focus if I click the blue bar
at the top. The minimize and maximize button do not work either.
Does it sound like I missed something?

I think I may also need to play around with how often I refresh and
PeekMessage. With 11K records to process I don't want to waste
overhead on refreshing too much, especially if the user can't see
the change anyway.

Interesting reading on the MSDN article.

Peekmessage is only a work-around to be able to update the display easily.
As the thread is still doing the work, there is no time to process messages
like mouse clicks or keyboard input. If you want to work with your Form
while the process is going on, you should consider putting the work into a
separate thread.


Armin
 
Back
Top