Solved

VB6 DoEvents for Refreshing Only

Posted on 2007-12-05
5
2,671 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
5 Comments
 
LVL 13

Expert Comment

by:jmundsack
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
0
 

Author Comment

by:mecdesign
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now