ooooooooooooooooooooooooooooooooooooooooooooooooooo
I could replicate a result you get on an XP box as well.
Zach.
Here are my findings.
[Setup]
I created a simple Windows Application project. On Form1 I placed a list
view control (listView1). I added three items (Item 1, Item 2, Item 3) in
design mode. I did this so that I could right-click on both items and the
empty space of the list view. I also added a ContextMenuStrip to the form
(contextMenuStrip1) and put three menu items in it. For display purposes
only I named them Cut, Copy, and Paste (there's no functionality behind
them).
[Case 1]
Changes: I set the listView1.ContextMenuStrip = contextMenuStrip1.
Result: When I right-click on the list view, contextMenuStrip1 appears with
its top-left corner directly under my mouse pointer.
[Case 2]
Changes: I created an event handler for listView1.MouseDown and added this
code to it:
if (e.Button == MouseButtons.Right)
{
contextMenuStrip1.Show(100, 100);
}
I did not alter listView1.ContextMenuStrip. It is still set to
contextMenuStrip1.
Result: Clicking the right mouse button down immediately causes the context
menu to appear at physical screen point (100, 100). When I release the
button, the menu disappears and reappears under my mouse pointer.
[Case 3]
Changes: I set listView1.ContextMenuStrip = (none).
Result: The context menu appears at (100, 100) on mouse down and does not
disappear or move on mouse up.
[Case 4]
Changes: I removed the MouseDown event handler and added a handler for
MouseUp with the exact same code as MouseDown. listView1.ContextMenuStrip is
still set to (none).
Result: The menu does not appear until mouse up, at which time it appears at
(100, 100) and does not disappear or move.
[Case 5]
Changes: I set listView1.ContextMenuStrip = contextMenuStrip1 again.
Result: On mouse up, the menu flickers almost imperceptibly at (100, 100)
and then appears "for real" under the mouse pointer.
From this test, the only way to replicate the behavior you mentioned earlier
was to have BOTH the code (in an event handler) and Windows Forms (via the
ContextMenuStrip property) displaying the context menu. In that situation,
Windows Forms wins, and the context menu appears under the mouse pointer.
All I can suggest at this point is to check very carefully to make sure that
you have not set the ContextMenuHandler property for your list view.