FIX: Visual Basic 5.0 Focus Is Not Returned to a MDI Form After a Dialog Is ShownID: Q172111
|
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.
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
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.
Private Sub Picture1_Click()
MDIForm1.Enabled = False
CommonDialog1.ShowOpen
MDIForm1.Enabled = True
End Sub
Additional query words:
kbVBp300bug kbVBp400bug kbVBp500bug kbVBp600fix kbVBp kbdsd kbDSupport
kbControl kbMDI
Keywords :
Version :
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: June 17, 1999