Open contextmenustrip when you right-click the items displayed in the listbox

0

I tried this way:

private void listBox1_MouseDown(object sender, MouseEventArgs e)
    {
        if (e.Button == MouseButtons.Right)
        {
            contextMenuStrip1.Show(listBox1.PointToScreen(new Point(e.X, e.Y)));
        }
    }

But I need it to be in the items displayed in the listbox not in the entire listbox, how can I do it?

    
asked by anonymous 01.10.2017 / 16:24

0 answers