FIX: DBCombo Control Does Not Allow Selection on Modal Form (150210)
The information in this article applies to:
- 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 Q150210 SUMMARY
If a DBCombo control is placed on a form that is shown modally, then the
user is unable to click a selection of the drop-down list. This behavior
only occurs in an EXE file, it does not occur in the Design Environment of
Visual Basic.
WORKAROUND
To work around this problem, the function below can be used to simulate
showing a form modally. The workaround allows the DBCombo control to be
used.
Instead of showing a form modally, show the form using a method such as the
one documented below. For example, to simulate invoking Form1 modally, call
the method as shown below:
ShowModalForm Form1
The subroutine ShowModalForm is shown below, and can be placed in a Form or
standard code module:
Public Sub ShowModalForm(frmTarget As Form)
Dim ofrm As Object
'Disable all the forms
For Each ofrm In Forms
ofrm.Enabled = False
Next ofrm
'Now show the target form non-modal
frmTarget.Show
'If the frmTarget was disabled by the loop above
'make sure it is now enabled
frmTarget.Enabled = True
'Sit in a loop until the target form is dismissed
Do While frmTarget.Visible = True
DoEvents
Loop
'We have left the loop, so the dialog has been dismissed
'Now Enable the forms, and exit the procedure
For Each ofrm In Forms
ofrm.Enabled = True
Next ofrm
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: | Minor | Last Reviewed: | 7/16/2004 |
---|
Keywords: | kbBug kbfix kbVBp600fix KB150210 |
---|
|