Solved

VB6 DoEvents for Refreshing Only

Posted on 2007-12-05
5
2,682 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
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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

803 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