By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,567 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,567 IT Pros & Developers. It's quick & easy.

Update/Refresh Problem

P: n/a
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
Mar 20 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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" <bh***@optonline.net> schreef in bericht
news:Xn*******************************@207.46.248. 16...
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

Mar 20 '06 #2

P: n/a
"Bernie Hunt" <bh***@optonline.net> schrieb
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/en...sagequeues.asp

see also:
http://groups.google.com/group/micro...1d3b0355269ec2

ARmin

Mar 20 '06 #3

P: n/a
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
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in
news:uG**************@TK2MSFTNGP11.phx.gbl:
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" <bh***@optonline.net> schreef in bericht
news:Xn*******************************@207.46.248. 16...
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



Mar 20 '06 #4

P: n/a
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

"Bernie Hunt" <bh***@optonline.net> schreef in bericht
news:Xn*******************************@207.46.248. 16...
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
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in
news:uG**************@TK2MSFTNGP11.phx.gbl:
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" <bh***@optonline.net> schreef in bericht
news:Xn*******************************@207.46.248. 16...
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


Mar 20 '06 #5

P: n/a
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!
"Armin Zingler" <az*******@freenet.de> wrote in
news:ey**************@TK2MSFTNGP12.phx.gbl:
"Bernie Hunt" <bh***@optonline.net> schrieb
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/en...wsuserinterfac
e/windowing/messagesandmessagequeues/aboutmessagesandmessagequeues.asp

see also:
http://groups.google.com/group/micro...nguages.vb/bro
wse_frm/thread/1682ea1a86cec239/301d3b0355269ec2

ARmin


Mar 20 '06 #6

P: n/a
"Bernie Hunt" <bh***@optonline.net> schrieb
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

Mar 20 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.