The datagrid control uses the sequence of MouseDown, MouseUp, MouseDown, MouseUp to fire a double click event. When you open a Modal dialog in the double click event, for some reason, the last MouseUp message is sent to the modal dialog, but not to the DataGrid. When the modal dialog is closed, the DataGrid is still waiting for the MouseUp Message, so the problem Occurs.
A similar problem is addressed in <http://support.microsoft.com/?id=305101>
To work aroud the problem the MouseUp message has to be sent manually to the Datagrid by calling the mouse_event API. See the next example:
Option Explicit
Private Declare Sub mouse_event Lib "user32" ( _
ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, _
ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTUP = &H4
Private Sub DataGrid1_DblClick()
With DataGrid1
frmCalendar.Show vbModal
.Text = CStr(gDate)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.