The information in this article applies to:
SYMPTOMSDebug.Print used within the MouseMove event procedure of a form or control causes a MouseMove event. If the mouse cursor is located within the form or control, an endless stream of output to the Immediate Window will occur. This behavior occurs for a program run in the Visual Basic development environment. An .EXE program does not utilize the Immediate Window and the Debug object so this behavior does not apply to a .EXE program. The problem does not occur if a Print method is issued to any other form or control in the program. STATUSThis is not a problem with Visual Basic, but rather the nature of the Microsoft Windows operating environment. This problem does not occur in Visual Basic version 2.0 or 3.0. MORE INFORMATION
If Debug.Print is used within the MouseMove event procedure of a form
or control, an endless stream of output is sent to the Immediate
Window. This occurs whenever the mouse cursor is within the form or
control. This behavior occurs because the Debug.Print statement causes
the focus to change briefly to the Immediate Window. When the focus
returns to the form or control, Windows generates a MouseMove event
that is processed by Visual Basic. There is no way for Visual Basic to
suppress MouseMove events that are generated by Windows. The easiest
way to overcome this behavior is to send debug output to another form
or control.
If you want output to be sent only when the mouse is moved, then all
Debug.Print statements within the MouseMove event procedure should be
changed to Print methods to other forms or controls. Below is a
description of how to modify the example above such that output is
produced only when the mouse is moved.
Add another form (Form2) to the project by selecting New Form from the File menu (ALT F+F). Change the Debug.Print statement in the MouseMove event procedure for Picture1 to Form2.Print. Below is a copy of the above sample modified to send output to another form.
In the example above, all output that scrolls off the form will be
lost. A more sophisticated routine will be required to keep track of
all output to the form. Such a routine is beyond the scope of this
article.
Additional query words: fixlist2.00 fixlist3.00 2.00 3.00
Keywords : |
Last Reviewed: January 20, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |