FIX: Visual Basic 5.0 Focus Is Not Returned to a MDI Form After a Dialog Is Shown (172111)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q172111 SYMPTOMS
In the versions of Microsoft Visual Basic listed at the beginning of this
article, if an MDI Form's Enabled property is set to False before a
CommonDialog (such as ShowOpen) is displayed, the focus does not return to
the MDI form, even if it is set programmatically. The subsequent behavior
is that instead of giving the MDI form the focus, focus is given to the
last window that had focus before the MDI form.
RESOLUTION
The current workaround for this confirmed bug is to not set the MDI
Form's Enabled property to False. The CommonDialog is Modal and
automatically disables the MDI Form because of its Modal nature. Thus
the workaround code for the code example in this article is:
Private Sub Picture1_Click()
CommonDialog1.ShowOpen
End Sub
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Basic
6.0.
Modification Type: | Major | Last Reviewed: | 12/10/2003 |
---|
Keywords: | kbbug kbfix kbGrpDSVB KB172111 kbAudDeveloper |
---|
|