Solved

VB6 DoEvents for Refreshing Only

Posted on 2007-12-05
5
2,697 Views
Last Modified: 2012-08-13
Is there an elegant way to use "DoEvents" in order to allow all the controls to repaint, but to ignore events triggered by the user during that time?

It's my understanding that DoEvents processes all of the messages in the message queue, not just the paint messages.
0
Comment
Question by:mecdesign
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 13

Expert Comment

by:jmundsack
ID: 20412824
You could set the form's .Enabled property to False which would make it ignore all mouse and keyboard events but it would still respond to other events.  Then when you're done with the loop set the enabled property to True again.
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 20412893
may be

dim ctrl as control

on error resume next
for each ctrl in controls
    ctrl. Refresh
next
0
 
LVL 10

Expert Comment

by:3_S
ID: 20414390
you can also just do a refresh on your form (this includes everything on it)
me.refresh
0
 
LVL 17

Accepted Solution

by:
Shanmuga Sundaram earned 500 total points
ID: 20418526
0
 

Author Comment

by:mecdesign
ID: 20583450
I was hoping to find something that could resolve "app is not responding" issues.

Unfortunately, trying to get around that problem caused more problems like crashing when I experimented using DoEvents and DoEvents while disabling specific controls in this application.

This link from shasunder was pretty close to what I was looking for though:
http://www.vbaccelerator.com/home/VB/Tips/Force_An_Area_of_a_Window_To_Repaint/article.asp

Thanks for your help!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question