Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen Display Messed Up.

Status
Not open for further replies.

fcoomermd

Programmer
Nov 20, 2002
218
CA
I have a main app, with Tabs, Labels and TextBoxes, etc. I have a procedure from the Main app, which launches a form, which has a Progress Bar built in. The procedure runs some routines, etc., and updates the Progress Bar based on the work completed.
PROBLEM:
If I, or the user tabs (Alt-Tab) to another App, then returns to my app, the screens are messed up, but only until the application is finished processing...
Any suggessions?
Thanks
 
My.Application.DoEvents may be a suitable solution for you. You can use it in your routines to allow Windows to process all messages in the current queue.

Best regards,
Harold

***You can't change your past, but you can change your future***
 
if wraygun's solution alone still does not handle your issue then you may also try to imploy Me.Refresh() or Me.ParentForm.Refresh().

Just remember to put them in the processing loop so that the lines get called fairly often.

Senior Software Developer
 

A better alternative would be to pass the time consuming procedure to a separate thread.

A discussion of this was started by me (at that time extolling the virtues of DoEvents because I couldn't then get threading to work the way I needed) in thread796-1110316, which culminated in three excellent FAQs by ThatRickGuy: faq796-5929, faq796-6036 and faq796-6056

I'm sure if (or when) Rick sees this thread he will provide strong reasons for not using DoEvents, as he has done in the many threads since the one above where I suggested its use.


Hope this helps.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top