PRB: No Events Generated When Msgbox Active (76557)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
This article was previously published under Q76557 SYMPTOMS
Visual Basic does not invoke the Paint event or any other event for
controls or forms while a MsgBox or InputBox is active.
CAUSE
This behavior is by design. All events (including the timer control event)
are disabled while a MsgBox is showing. The purpose is to block operations
that could cause problems.
WORKAROUND
To compensate for Paint events not firing, you can set the form AutoRedraw
property to True and paint the form from the Form_Load event.
To display a MsgBox-like dialog and allow all events to occur, you can: - Call the Windows API function MessageBox.
- Display a modal form (formN.Show 1), which looks like the MsgBox dialog.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 12/12/2003 |
---|
Keywords: | kbprb KB76557 |
---|
|