0

The attached program has a small bug when you right click on an item. The first time you right click any item it'll throw the context menu (it's the same menu under File) all the way up to the top left of the screen, but the second time you right click it'll appear in the right spot. It only does this once. Why would it be doing this? How can I fix it? :?:

Here is the code that runs when you right click.

private void FileBrowser_MouseClick(object sender, MouseEventArgs e)
        {
            FileBrowser.Update();

            if (e.Button == MouseButtons.Right)
            {
                //Show it relative to the FileBrowser at the location of the mouse
                FileContextMenu.Show(FileBrowser, e.Location);
            }
        }
2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by WildBamaBoy
0

What I got from that was to assign the context menu to the control on right click.
That made it a little better but created a new problem. The menu isn't thrown to the top left of the screen anymore, instead it shows up under the File button on the first click. It also shows up wherever I click in the ListView. I need it to show up only when an item is right clicked.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.