Why when clicking mouse right button on listBox it's working everywhere in the listBox area?
<p>I have this two events in Form1:</p>

<pre><code>private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
        {
            //clear the menu and add custom items
            contextMenuStrip1.Items.Clear();
            contextMenuStrip1.Items.Add(string.Format("Edit - {0}", listBox1.SelectedItem.ToString()));
        }

        private void listBox1_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                int index = listBox1.IndexFromPoint(e.Location);
                if (index == -1) return;
                contextMenuStrip1.Show(listBox1,listBox1.PointToClient(System.Windows.Forms.Cursor.Position));                
            }
        }
</code></pre>

<p>In the designer I have a ContextMenuStrip and a listBox controls.</p>

<p>What I need it to do is when I click on the mouse right button anywhere on the listBox area it will not do anything. But If I click only on the selected item in the listBox then the contextMenuStrip will show. Only if the mouse above/on the selected item in the listBox.</p>

<p>When my program is running already the first item is selected so I need that once I run my program if I move my mouse above the selected item and make right click button it will work. If i'm not on the selected item it will not work. I mean only if the mouse cursor is above the selected item then right click will work and show the contextmenustrip.</p>

<p>Not ifi  move the mouse over the selected item if I put the mouse over the selected item now if I click the right mouse button it will work.</p>
