Skip to content

Instantly share code, notes, and snippets.

@afrael
Created June 27, 2011 14:52
Show Gist options
  • Save afrael/1049017 to your computer and use it in GitHub Desktop.
Save afrael/1049017 to your computer and use it in GitHub Desktop.
Disabling MouseWheel behavior
// in form InitializeComponent(), or in the form's constructor
this.cboBox.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.cboBox_MouseWheel);
// event implementation
private void cboBox_MouseWheel(object sender, System.Windows.Forms.MouseEventArgs e)
{
HandledMouseEventArgs mouseWheelEvent = (HandledMouseEventArgs)e;
mouseWheelEvent.Handled = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment