Skip to content

Instantly share code, notes, and snippets.

@jscfping
Created April 26, 2021 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jscfping/b58b1fd844744541fb6c49e669cf2b96 to your computer and use it in GitHub Desktop.
Save jscfping/b58b1fd844744541fb6c49e669cf2b96 to your computer and use it in GitHub Desktop.
private void listBox1_MouseDown(object sender, MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
listBox1.SelectedIndex = listBox1.IndexFromPoint(e.X, e.Y);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment