C# How to select ListBox item with a RightClick?
问题 I have tried a lot of methods for this and done hours of research, but it just never seems to work for me. This is my current code, and I don't know why it shouldn't work. private void listBox1_MouseDown(object sender, MouseEventArgs e) { listBox1.SelectedIndex = listBox1.IndexFromPoint(e.X, e.Y); if (e.Button == MouseButtons.Right) { contextMenuStrip1.Show(); } } Also I don't care about the context menu that can be removed I am just looking for a way to make the right mouse button select the