FIX: MouseMove Button Is Incorrect with ListView MultiSelect (149275)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
- 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
This article was previously published under Q149275 SYMPTOMS
The Button argument of the ListView's MouseMove event may not always
correctly reflect the most current mouse button status. This can occur if
the MultiSelect property of the ListView control is set to True. The Button
argument of the MouseMove event is updated only when the MouseDown event is
fired, not every time the MouseMove event is fired.
RESOLUTION
To work around this problem, one could use an OCX or tool that allows the
trapping of Windows messages. The code would need to be written, but one
possible scheme could involve a flag variable that would be set whenever
the ListView control received a WM_LBUTTONDOWN or WM_RBUTTONDOWN message
and only reset when a corresponding WM_LBUTTONUP or WM_RBUTTONUP message
was received. This flag variable could be used as the equivalent of the
button argument in the MouseMove event, because it will return different
values when the mouse button has been clicked or when the mouse button has
been clicked but not released. The Message Blaster OCX, produced by
WareWithAll, is a good tool to use to trap Windows messages.
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/13/2004 |
---|
Keywords: | kbbug kbfix KB149275 |
---|
|