Next silly question. Msgbox parts remain on form

S

StrandElectric

I have a number of entry boxes in my program. Thye work fine,
but...Inconsistently, parts of them remain scattered on my form when inputs
have been finished.

Any ideas?
 
D

Dennis

parts of them remain scattered on my form when inputs
have been finished.

Without seeing the code, I can only suggest that you Refresh() the form
after the dialog closes. But seeing the code around the display of the
dialog might help in formulating a better answer.
 
S

StrandElectric

Dennis said:
Without seeing the code, I can only suggest that you Refresh() the form
after the dialog closes. But seeing the code around the display of the
dialog might help in formulating a better answer.

Thanks Dennis. I'll try that first before inflicting reams of code on you.
You are a great practical help. I can digest your simple solutions much
better than lengthy abstractions!
 
D

Dennis

I'll try that first before inflicting reams of code on you.

The Refresh() should work, but it also may only mask the real problem
(why the form isn't being refreshed in a normal fashion). You may be
doing something immediately after the closing of the dialog which is
causing the WM_PAINT messages (low priority) to not get processed in a
timely manner. The Refresh() should force that to happen, but a look at
the surrounding code might bring to light the true cause of the problem.
 
A

Armin Zingler

Am 12.01.2011 20:43, schrieb StrandElectric:
I have a number of entry boxes in my program. Thye work fine,
but...Inconsistently, parts of them remain scattered on my form when inputs
have been finished.

Any ideas?

The reason can be the same is in the other thread:
If you start a longer process (a loop or whatever) in the UI thread,
you prevent it from doing it's actual task which includes painting
the Forms. The solution is doing the additional work in another thread.
Writing multi-threaded programs is an advanced programming technique.
 
S

StrandElectric

Dennis said:
The Refresh() should work, but it also may only mask the real problem
(why the form isn't being refreshed in a normal fashion). You may be
doing something immediately after the closing of the dialog which is
causing the WM_PAINT messages (low priority) to not get processed in a
timely manner. The Refresh() should force that to happen, but a look at
the surrounding code might bring to light the true cause of the problem.

Thanks Dennis, but I hesitate to inflict the whole app on you and the group,
especially as it's double spaced for some reason! Your solution works, BTW
 
D

Dennis

Thanks Dennis, but I hesitate to inflict the whole app on you and the group,
especially as it's double spaced for some reason! Your solution works, BTW

OK. The Refresh() may be the right answer for your situation, even if it
is hiding the real cause. I have used it myself (after looking at the
surrounding code).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top